diff options
Diffstat (limited to 'spec/support/shared_examples/features/sidebar_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/sidebar_shared_examples.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/support/shared_examples/features/sidebar_shared_examples.rb b/spec/support/shared_examples/features/sidebar_shared_examples.rb index 5bfe929e957..d509d124de0 100644 --- a/spec/support/shared_examples/features/sidebar_shared_examples.rb +++ b/spec/support/shared_examples/features/sidebar_shared_examples.rb @@ -52,16 +52,17 @@ RSpec.shared_examples 'issue boards sidebar' do it 'shows toggle as on then as off as user toggles to subscribe and unsubscribe', :aggregate_failures do wait_for_requests + subscription_button = find('[data-testid="subscription-toggle"]') - click_button 'Notifications' + subscription_button.click - expect(page).to have_button('Notifications', class: 'is-checked') + expect(subscription_button).to have_css("button.is-checked") - click_button 'Notifications' + subscription_button.click wait_for_requests - expect(page).not_to have_button('Notifications', class: 'is-checked') + expect(subscription_button).to have_css("button:not(.is-checked)") end context 'when notifications have been disabled' do @@ -73,7 +74,7 @@ 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).to have_button('Notifications', class: 'is-disabled') + expect(page).to have_selector('[data-testid="subscription-toggle"]', class: 'is-disabled') expect(page).to have_content('Disabled by project owner') end end |