Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-15 18:09:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-15 18:09:11 +0300
commit10130901f1128c91596c4cbfe14b1e5c9f15032f (patch)
tree18051a0297d9af135e4546689a91b9033bae6f59 /spec/features/whats_new_spec.rb
parent69b0ff9002af73de066a6f28e4a61ccf1fddd9a7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/whats_new_spec.rb')
-rw-r--r--spec/features/whats_new_spec.rb62
1 files changed, 44 insertions, 18 deletions
diff --git a/spec/features/whats_new_spec.rb b/spec/features/whats_new_spec.rb
index 7c5625486f5..55b96361f03 100644
--- a/spec/features/whats_new_spec.rb
+++ b/spec/features/whats_new_spec.rb
@@ -2,34 +2,60 @@
require "spec_helper"
-RSpec.describe "renders a `whats new` dropdown item", :js do
+RSpec.describe "renders a `whats new` dropdown item" do
let_it_be(:user) { create(:user) }
- before do
- sign_in(user)
- end
+ context 'when not logged in' do
+ it 'and on .com it renders' do
+ allow(Gitlab).to receive(:com?).and_return(true)
- it 'shows notification dot and count and removes it once viewed' do
- visit root_dashboard_path
+ visit user_path(user)
- page.within '.header-help' do
- expect(page).to have_selector('.notification-dot', visible: true)
+ page.within '.header-help' do
+ find('.header-help-dropdown-toggle').click
- find('.header-help-dropdown-toggle').click
+ expect(page).to have_button(text: "What's new")
+ end
+ end
+
+ it "doesn't render what's new" do
+ visit user_path(user)
- expect(page).to have_button(text: "What's new")
- expect(page).to have_selector('.js-whats-new-notification-count')
+ page.within '.header-help' do
+ find('.header-help-dropdown-toggle').click
+
+ expect(page).not_to have_button(text: "What's new")
+ end
+ end
+ end
- find('button', text: "What's new").click
+ context 'when logged in', :js do
+ before do
+ sign_in(user)
end
- find('.whats-new-drawer .gl-drawer-close-button').click
- find('.header-help-dropdown-toggle').click
+ it 'shows notification dot and count and removes it once viewed' do
+ visit root_dashboard_path
+
+ page.within '.header-help' do
+ expect(page).to have_selector('.notification-dot', visible: true)
+
+ find('.header-help-dropdown-toggle').click
+
+ expect(page).to have_button(text: "What's new")
+ expect(page).to have_selector('.js-whats-new-notification-count')
+
+ find('button', text: "What's new").click
+ end
+
+ find('.whats-new-drawer .gl-drawer-close-button').click
+ find('.header-help-dropdown-toggle').click
- page.within '.header-help' do
- expect(page).not_to have_selector('.notification-dot', visible: true)
- expect(page).to have_button(text: "What's new")
- expect(page).not_to have_selector('.js-whats-new-notification-count')
+ page.within '.header-help' do
+ expect(page).not_to have_selector('.notification-dot', visible: true)
+ expect(page).to have_button(text: "What's new")
+ expect(page).not_to have_selector('.js-whats-new-notification-count')
+ end
end
end
end