Commit 926e5440 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'remove_dismissal_ability_from_manual_banners' into 'master'

Remove dismissal ability for manual banners

See merge request gitlab-org/gitlab!76869
parents 57b922db 188f9e45
......@@ -5,9 +5,9 @@
= render 'shared/global_alert',
title: payload.subject,
variant: payload.display_error_version? ? :danger : :warning,
close_button_class: 'js-close',
alert_class: 'gl-my-5',
alert_data: { testid: 'close-manual-quarterly-co-term-banner' } do
alert_data: { testid: 'manual-quarterly-co-term-banner' },
dismissible: false do
.gl-alert-body
= payload.body
.gl-alert-actions
......
......@@ -5,9 +5,9 @@
= render 'shared/global_alert',
title: payload.subject,
variant: payload.display_error_version? ? :danger : :warning,
close_button_class: 'js-close',
alert_class: 'gl-mt-5 gl-mb-5',
alert_data: { testid: 'close-manual-renewal-banner' } do
alert_class: 'gl-my-5',
alert_data: { testid: 'manual-renewal-banner' },
dismissible: false do
.gl-alert-body
= payload.body
.gl-alert-actions
......
# frozen_string_literal: true
RSpec.shared_examples 'manual quarterly co-term banner' do |path_to_visit:|
shared_examples 'a visible dismissible manual quarterly co-term banner' do
context 'when dismissed' do
before do
page.within(find('[data-testid="close-manual-quarterly-co-term-banner"]', match: :first)) do
click_button 'Dismiss'
end
end
it_behaves_like 'a hidden manual quarterly co-term banner'
context 'when visiting again' do
before do
visit current_path
end
shared_examples 'a visible manual quarterly co-term banner' do
it 'displays a banner' do
expect(page).to have_selector('[data-testid="close-manual-quarterly-co-term-banner"]')
end
end
expect(page).to have_selector('[data-testid="manual-quarterly-co-term-banner"]')
end
end
shared_examples 'a hidden manual quarterly co-term banner' do
it 'does not display a banner' do
expect(page).not_to have_selector('[data-testid="close-manual-quarterly-co-term-banner"]')
expect(page).not_to have_selector('[data-testid="manual-quarterly-co-term-banner"]')
end
end
......@@ -56,7 +40,7 @@ RSpec.shared_examples 'manual quarterly co-term banner' do |path_to_visit:|
context 'within notification window' do
let(:reconciliation_date) { Date.current + reminder_days }
it_behaves_like 'a visible dismissible manual quarterly co-term banner'
it_behaves_like 'a visible manual quarterly co-term banner'
end
context 'outside of notification window' do
......@@ -69,7 +53,7 @@ RSpec.shared_examples 'manual quarterly co-term banner' do |path_to_visit:|
context 'when reconciliation date was passed' do
let(:reconciliation_date) { Date.current }
it_behaves_like 'a visible dismissible manual quarterly co-term banner'
it_behaves_like 'a visible manual quarterly co-term banner'
end
context 'when reconciliation date is outside of the notification window' do
......
# frozen_string_literal: true
RSpec.shared_examples 'manual renewal banner' do |path_to_visit:|
shared_examples 'a visible dismissible manual renewal banner' do
context 'when dismissed' do
before do
page.within(find('[data-testid="close-manual-renewal-banner"]', match: :first)) do
click_button 'Dismiss'
end
end
it_behaves_like 'a hidden manual renewal banner'
context 'when visiting again' do
before do
visit current_path
end
shared_examples 'a visible manual renewal banner' do
it 'displays a banner' do
expect(page).to have_selector('[data-testid="close-manual-renewal-banner"]')
end
end
expect(page).to have_selector('[data-testid="manual-renewal-banner"]')
end
end
shared_examples 'a hidden manual renewal banner' do
it 'does not display a banner' do
expect(page).not_to have_selector('[data-testid="close-manual-renewal-banner"]')
expect(page).not_to have_selector('[data-testid="manual-renewal-banner"]')
end
end
......@@ -54,7 +38,7 @@ RSpec.shared_examples 'manual renewal banner' do |path_to_visit:|
context 'within notification window' do
let(:expires_at) { Date.today + reminder_days }
it_behaves_like 'a visible dismissible manual renewal banner'
it_behaves_like 'a visible manual renewal banner'
end
context 'outside of notification window' do
......@@ -67,7 +51,7 @@ RSpec.shared_examples 'manual renewal banner' do |path_to_visit:|
context 'when subscription is expired' do
let(:expires_at) { Date.today }
it_behaves_like 'a visible dismissible manual renewal banner'
it_behaves_like 'a visible manual renewal banner'
end
context 'when subscription is not expiring/expired yet' do
......
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