Skip to content

Commit

Permalink
Fix typo in govuk-width-container class name
Browse files Browse the repository at this point in the history
Also bump the version as this will need a release and add some tests
covering the forgotten width container
  • Loading branch information
peteryates committed Sep 8, 2024
1 parent bf86f56 commit 0a492c5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def initialize(service_name: nil, service_url: nil, navigation_items: [], curren

def call
outer_element do
tag.div(class: "#{brand}-width_container") do
tag.div(class: "#{brand}-width-container") do

This comment has been minimized.

Copy link
@peteryates

peteryates Sep 8, 2024

Author Member

🙈

safe_join(
[
start_slot,
Expand Down
2 changes: 1 addition & 1 deletion lib/govuk/components/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Govuk
module Components
VERSION = '5.6.0'.freeze
VERSION = '5.6.1'.freeze
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@

specify 'contains the service name in a span' do
expect(rendered_content).to have_tag("section", with: { class: component_css_class }) do
with_tag('div', with: { class: 'govuk-service-navigation__container' }) do
with_tag('span', class: 'govuk-service-navigation__service-name') do
with_tag('span', text: service_name, with: { class: 'govuk-service-navigation__text' })
with_tag('div', with: { class: 'govuk-width-container' }) do
with_tag('div', with: { class: 'govuk-service-navigation__container' }) do
with_tag('span', class: 'govuk-service-navigation__service-name') do
with_tag('span', text: service_name, with: { class: 'govuk-service-navigation__text' })
end
end
end
end
Expand All @@ -47,9 +49,11 @@

specify 'contains a hyperlink with the service name and url' do
expect(rendered_content).to have_tag("section", with: { class: component_css_class }) do
with_tag('div', with: { class: 'govuk-service-navigation__container' }) do
with_tag('span', class: 'govuk-service-navigation__service-name') do
with_tag('a', text: service_name, with: { href: service_url, class: 'govuk-service-navigation__link' })
with_tag('div', with: { class: 'govuk-width-container' }) do
with_tag('div', with: { class: 'govuk-service-navigation__container' }) do
with_tag('span', class: 'govuk-service-navigation__service-name') do
with_tag('a', text: service_name, with: { href: service_url, class: 'govuk-service-navigation__link' })
end
end
end
end
Expand All @@ -67,11 +71,13 @@

specify 'the items are rendered in a list' do
expect(rendered_content).to have_tag("div", with: { class: component_css_class }) do
with_tag('div', with: { class: 'govuk-service-navigation__container' }) do
with_tag('ul', with: { class: 'govuk-service-navigation__list' }) do
navigation_items.each do |ni|
with_tag('li', with: { class: 'govuk-service-navigation__item' }) do
with_tag('a', text: ni.fetch(:text), with: { href: ni.fetch(:href) })
with_tag('div', with: { class: 'govuk-width-container' }) do
with_tag('div', with: { class: 'govuk-service-navigation__container' }) do
with_tag('ul', with: { class: 'govuk-service-navigation__list' }) do
navigation_items.each do |ni|
with_tag('li', with: { class: 'govuk-service-navigation__item' }) do
with_tag('a', text: ni.fetch(:text), with: { href: ni.fetch(:href) })
end
end
end
end
Expand All @@ -95,13 +101,15 @@

specify 'the menu button is present' do
expect(rendered_content).to have_tag("div", with: { class: component_css_class }) do
with_tag('div', with: { class: 'govuk-service-navigation__container' }) do
with_tag('button', with: {
type: 'button',
class: %w(govuk-service-navigation__toggle govuk-js-service-navigation-toggle),
hidden: 'hidden',
'aria-controls' => 'navigation'
})
with_tag('div', with: { class: 'govuk-width-container' }) do
with_tag('div', with: { class: 'govuk-service-navigation__container' }) do
with_tag('button', with: {
type: 'button',
class: %w(govuk-service-navigation__toggle govuk-js-service-navigation-toggle),
hidden: 'hidden',
'aria-controls' => 'navigation'
})
end
end
end
end
Expand Down

0 comments on commit 0a492c5

Please sign in to comment.