Commit 5e5cdaec authored by Justin Ho's avatar Justin Ho

Add specs for dismissing of message

parent 0f36dcd7
......@@ -12,7 +12,7 @@
%th{ role: 'columnheader', scope: 'col', 'aria-colindex': 4 }= _('Last updated')
%tbody{ role: 'rowgroup' }
- @integrations.each do |integration|
- @integrations&.each do |integration|
%tr{ role: 'row' }
%td{ role: 'cell', 'aria-colindex': 1 }
= boolean_to_icon integration.activated?
......
......@@ -235,6 +235,25 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc
end
end
context 'Integration page', :js do
before do
visit integrations_admin_application_settings_path
end
it 'allows user to dismiss deprecation notice' do
expect(page).to have_content('Some settings have moved')
click_button 'Dismiss'
wait_for_requests
expect(page).not_to have_content('Some settings have moved')
visit integrations_admin_application_settings_path
expect(page).not_to have_content('Some settings have moved')
end
end
context 'CI/CD page' do
it 'Change CI/CD settings' do
visit ci_cd_admin_application_settings_path
......
......@@ -47,6 +47,26 @@ describe UserCalloutsHelper do
end
end
describe '.show_admin_integrations_moved?' do
subject { helper.show_admin_integrations_moved? }
context 'when user has not dismissed' do
before do
allow(helper).to receive(:user_dismissed?).with(described_class::ADMIN_INTEGRATIONS_MOVED) { false }
end
it { is_expected.to be true }
end
context 'when user dismissed' do
before do
allow(helper).to receive(:user_dismissed?).with(described_class::ADMIN_INTEGRATIONS_MOVED) { true }
end
it { is_expected.to be false }
end
end
describe '.render_flash_user_callout' do
it 'renders the flash_user_callout partial' do
expect(helper).to receive(:render)
......
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