Commit 38228cd9 authored by Enrique Alcantara's avatar Enrique Alcantara

Fix notifications dropdown e2e tests

Change the selectors to interact with
the notifications dropdown in feature
tests
parent bb77e90b
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
</script> </script>
<template> <template>
<div :class="containerClass" data-testid="notification-button"> <div :class="containerClass">
<gl-dropdown <gl-dropdown
v-gl-tooltip="{ title: buttonTooltip }" v-gl-tooltip="{ title: buttonTooltip }"
data-testid="notification-dropdown" data-testid="notification-dropdown"
......
...@@ -170,14 +170,14 @@ RSpec.describe 'Group show page' do ...@@ -170,14 +170,14 @@ RSpec.describe 'Group show page' do
it 'is enabled by default' do it 'is enabled by default' do
visit path visit path
expect(page).to have_selector('[data-testid="notification-dropdown"]:not(.disabled)') expect(page).to have_selector('[data-testid="notification-dropdown"] button:not(.disabled)')
end end
it 'is disabled if emails are disabled' do it 'is disabled if emails are disabled' do
group.update_attribute(:emails_disabled, true) group.update_attribute(:emails_disabled, true)
visit path visit path
expect(page).to have_selector('[data-testid="notification-dropdown"].disabled') expect(page).to have_selector('[data-testid="notification-dropdown"] .disabled')
end end
end end
......
...@@ -25,7 +25,7 @@ RSpec.describe 'User visits the notifications tab', :js do ...@@ -25,7 +25,7 @@ RSpec.describe 'User visits the notifications tab', :js do
let(:project) { create(:project, emails_disabled: true) } let(:project) { create(:project, emails_disabled: true) }
it 'notification button is disabled' do it 'notification button is disabled' do
expect(page).to have_selector('[data-testid="notification-dropdown"].disabled') expect(page).to have_selector('[data-testid="notification-dropdown"] .disabled')
end end
end end
end end
...@@ -10,7 +10,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do ...@@ -10,7 +10,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
end end
def click_notifications_button def click_notifications_button
first('[data-testid="notification-button"]').click first('[data-testid="notification-dropdown"]').click
end end
it 'changes the notification setting' do it 'changes the notification setting' do
...@@ -22,7 +22,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do ...@@ -22,7 +22,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
click_notifications_button click_notifications_button
page.within first('[data-testid="notification-button"]') do page.within first('[data-testid="notification-dropdown"]') do
expect(page.find('.gl-new-dropdown-item.is-active')).to have_content('On mention') expect(page.find('.gl-new-dropdown-item.is-active')).to have_content('On mention')
expect(page).to have_css('[data-testid="notifications-icon"]') expect(page).to have_css('[data-testid="notifications-icon"]')
end end
...@@ -33,7 +33,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do ...@@ -33,7 +33,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
click_notifications_button click_notifications_button
click_button 'Disabled' click_button 'Disabled'
page.within first('[data-testid="notification-button"]') do page.within first('[data-testid="notification-dropdown"]') do
expect(page).to have_css('[data-testid="notifications-off-icon"]') expect(page).to have_css('[data-testid="notifications-off-icon"]')
end end
end end
...@@ -80,7 +80,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do ...@@ -80,7 +80,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
it 'is disabled' do it 'is disabled' do
visit project_path(project) visit project_path(project)
expect(page).to have_selector('[data-testid="notification-button"].disabled', visible: true) expect(page).to have_selector('[data-testid="notification-dropdown"] .disabled', visible: true)
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment