Commit 5a5208bb authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'remove-close-button-from-flash-warning' into 'master'

Don’t show close icon on flash warning

See merge request gitlab-org/gitlab!36581
parents 5a6fea76 1ce06f62
...@@ -8,5 +8,6 @@ ...@@ -8,5 +8,6 @@
%div{ class: "flash-#{key} mb-2" } %div{ class: "flash-#{key} mb-2" }
= sprite_icon(icons[key], size: 16, css_class: 'align-middle mr-1') unless icons[key].nil? = sprite_icon(icons[key], size: 16, css_class: 'align-middle mr-1') unless icons[key].nil?
%span= value %span= value
- if %w(alert notice success).include?(key)
%div{ class: "close-icon-wrapper js-close-icon" } %div{ class: "close-icon-wrapper js-close-icon" }
= sprite_icon('close', size: 16, css_class: 'close-icon') = sprite_icon('close', size: 16, css_class: 'close-icon')
---
title: Don’t show close icon on flash warning
merge_request: 36581
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/_flash' do
before do
allow(view).to receive(:flash).and_return(flash)
render
end
describe 'closable flash messages' do
%w(alert notice success).each do |flash_type|
let(:flash) { { flash_type => 'This is a closable flash message' } }
it 'shows a close button' do
expect(rendered).to include('js-close-icon')
end
end
end
describe 'non closable flash messages' do
%w(error message toast warning).each do |flash_type|
let(:flash) { { flash_type => 'This is a non closable flash message' } }
it 'shows a close button' do
expect(rendered).not_to include('js-close-icon')
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