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 {
</script>
<template>
<div :class="containerClass" data-testid="notification-button">
<div :class="containerClass">
<gl-dropdown
v-gl-tooltip="{ title: buttonTooltip }"
data-testid="notification-dropdown"
......
......@@ -170,14 +170,14 @@ RSpec.describe 'Group show page' do
it 'is enabled by default' do
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
it 'is disabled if emails are disabled' do
group.update_attribute(:emails_disabled, true)
visit path
expect(page).to have_selector('[data-testid="notification-dropdown"].disabled')
expect(page).to have_selector('[data-testid="notification-dropdown"] .disabled')
end
end
......
......@@ -25,7 +25,7 @@ RSpec.describe 'User visits the notifications tab', :js do
let(:project) { create(:project, emails_disabled: true) }
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
......@@ -10,7 +10,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
end
def click_notifications_button
first('[data-testid="notification-button"]').click
first('[data-testid="notification-dropdown"]').click
end
it 'changes the notification setting' do
......@@ -22,7 +22,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
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).to have_css('[data-testid="notifications-icon"]')
end
......@@ -33,7 +33,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
click_notifications_button
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"]')
end
end
......@@ -80,7 +80,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
it 'is disabled' do
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
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