Skip to content

Commit

Permalink
Remove govuk-warning-text__icon
Browse files Browse the repository at this point in the history
This class is replaced with govuk-visually-hidden.

See alphagov/govuk-frontend#3569
  • Loading branch information
jrmhaig committed Feb 28, 2024
1 parent 50df222 commit 004080a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/govuk_component/warning_text_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module WarningTextHelpers
def govuk_warning_text(body = nil, assistive_text = t('common.warning'), **tag_options, &)
tag_options = prepend_classes('govuk-warning-text', tag_options)

text__assistive = tag.span(assistive_text, class: 'govuk-warning-text__assistive')
text__assistive = tag.span(assistive_text, class: 'govuk-visually-hidden')
content = sanitize(body)
tag.div(**tag_options) do
concat tag.span('!', class: 'govuk-warning-text__icon', 'aria-hidden': true)
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/govuk_component/warning_text_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
it 'adds nested span in strong tag with govuk class' do
is_expected.to have_tag(:div) do
with_tag(:strong) do
with_tag(:span, with: { class: 'govuk-warning-text__assistive' })
with_tag(:span, with: { class: 'govuk-visually-hidden' })
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def has_govuk_warning?(text = nil)
[
has_selector?('.govuk-warning-text strong.govuk-warning-text__text', text:),
has_selector?('.govuk-warning-text span.govuk-warning-text__icon', text: '!'),
has_selector?('.govuk-warning-text span.govuk-warning-text__assistive', text: 'Warning')
has_selector?('.govuk-warning-text span.govuk-visually-hidden', text: 'Warning')
].all?
end

Expand Down

0 comments on commit 004080a

Please sign in to comment.