Commit e301f300 authored by Alexander Turinske's avatar Alexander Turinske

Remove icon_size option for gl_badge_helper

- we should not allow customisation of the icon size
parent fffb3db6
......@@ -87,12 +87,7 @@ module BadgesHelper
if options[:icon]
icon_classes = GL_ICON_CLASSES.dup
icon_classes << "gl-mr-2" unless icon_only
icon = if options[:icon_size]
sprite_icon(options[:icon], size: options[:icon_size], css_class: icon_classes.join(' '))
else
sprite_icon(options[:icon], css_class: icon_classes.join(' '))
end
icon = sprite_icon(options[:icon], css_class: icon_classes.join(' '))
content = icon_only ? icon : icon + content
end
......
- if ::Gitlab::ExternalAuthorization.enabled? && @project
= content_for :header_content do
= gl_badge_tag(@project.external_authorization_classification_label, { variant: :danger, icon: 'lock-open', icon_size: 8 }, { class: 'has-tooltip', title: s_('ExternalAuthorizationService|Classification label') })
= gl_badge_tag(@project.external_authorization_classification_label, { variant: :danger, icon: 'lock-open' }, { class: 'has-tooltip', title: s_('ExternalAuthorizationService|Classification label') })
......@@ -113,13 +113,9 @@ RSpec.describe BadgesHelper do
it 'adds aria-label to element' do
expect(subject).to match(%r{<span .*aria-label="#{label}".*>})
end
end
describe 'icon size' do
subject { helper.gl_badge_tag(label, icon: 'question-o', icon_size: 8) }
it 'adds an img role to element' do
expect(subject).to match(%r{<svg .*class="s8.*".*>})
it 'does not add a spacing class to the icon' do
expect(subject).not_to match(spacing_class_regex)
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