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:
Diffstat (limited to 'spec/support/shared_examples/features/sidebar_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/features/sidebar_shared_examples.rb39
1 files changed, 30 insertions, 9 deletions
diff --git a/spec/support/shared_examples/features/sidebar_shared_examples.rb b/spec/support/shared_examples/features/sidebar_shared_examples.rb
index 429efbe6ba0..c9508818f74 100644
--- a/spec/support/shared_examples/features/sidebar_shared_examples.rb
+++ b/spec/support/shared_examples/features/sidebar_shared_examples.rb
@@ -44,22 +44,24 @@ RSpec.shared_examples 'issue boards sidebar' do
context 'in notifications subscription' do
it 'displays notifications toggle', :aggregate_failures do
page.within('[data-testid="sidebar-notifications"]') do
- expect(page).to have_selector('[data-testid="notification-subscribe-toggle"]')
+ expect(page).to have_selector('[data-testid="subscription-toggle"]')
expect(page).to have_content('Notifications')
- expect(page).not_to have_content('Notifications have been disabled by the project or group owner')
+ expect(page).not_to have_content('Disabled by project owner')
end
end
it 'shows toggle as on then as off as user toggles to subscribe and unsubscribe', :aggregate_failures do
- toggle = find('[data-testid="notification-subscribe-toggle"]')
+ wait_for_requests
- toggle.click
+ click_button 'Notifications'
- expect(toggle).to have_css("button.is-checked")
+ expect(page).to have_button('Notifications', class: 'is-checked')
- toggle.click
+ click_button 'Notifications'
- expect(toggle).not_to have_css("button.is-checked")
+ wait_for_requests
+
+ expect(page).not_to have_button('Notifications', class: 'is-checked')
end
context 'when notifications have been disabled' do
@@ -71,9 +73,28 @@ RSpec.shared_examples 'issue boards sidebar' do
it 'displays a message that notifications have been disabled' do
page.within('[data-testid="sidebar-notifications"]') do
- expect(page).not_to have_selector('[data-testid="notification-subscribe-toggle"]')
- expect(page).to have_content('Notifications have been disabled by the project or group owner')
+ expect(page).to have_button('Notifications', class: 'is-disabled')
+ expect(page).to have_content('Disabled by project owner')
+ end
+ end
+ end
+ end
+
+ context 'confidentiality' do
+ it 'make issue confidential' do
+ page.within('.confidentiality') do
+ expect(page).to have_content('Not confidential')
+
+ click_button 'Edit'
+ expect(page).to have_css('.sidebar-item-warning-message')
+
+ within('.sidebar-item-warning-message') do
+ click_button 'Turn on'
end
+
+ wait_for_requests
+
+ expect(page).to have_content('This issue is confidential')
end
end
end