From 2632ff73a2d63e514642fe089cb7e6b74a39618b Mon Sep 17 00:00:00 2001 From: Sonia Hussain Date: Thu, 8 Aug 2024 16:22:18 +0100 Subject: [PATCH] Fix: service manual mobile/tablet alignment - Removed "govuk-width-container" divs from service_manual_topic and application.html.erb as they were causing alignment issues on mobile and tablet views. This adjustment ensures that content sections are displayed correctly across different devices. - Improved the service manual_phase_label test to handle case sensitivity for "Alpha". Updated the test to ensure Capybara correctly identifies the phase label regardless of case, resolving the previous error. --- app/views/content_items/service_manual_topic.html.erb | 2 -- app/views/layouts/application.html.erb | 2 -- test/integration/service_manual_phase_label_test.rb | 4 +++- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/content_items/service_manual_topic.html.erb b/app/views/content_items/service_manual_topic.html.erb index 8b63869db..2b461ff83 100644 --- a/app/views/content_items/service_manual_topic.html.erb +++ b/app/views/content_items/service_manual_topic.html.erb @@ -4,7 +4,6 @@ <% content_for :phase_message do %> <%= render 'shared/custom_phase_message', phase: @content_item.phase %> <% end %> -
<%= render "govuk_publishing_components/components/breadcrumbs", { breadcrumbs: @content_item.breadcrumbs, @@ -89,4 +88,3 @@
- \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b8a944baf..feeb27d06 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,9 +10,7 @@ <%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase %> <% end %> <% if @content_item.service_manual? %> -
<%= render_phase_label @content_item, content_for(:phase_message) %> -
<% end %> <% if @content_item.show_default_breadcrumbs? %> diff --git a/test/integration/service_manual_phase_label_test.rb b/test/integration/service_manual_phase_label_test.rb index 728e36666..133a0ad9c 100644 --- a/test/integration/service_manual_phase_label_test.rb +++ b/test/integration/service_manual_phase_label_test.rb @@ -29,7 +29,9 @@ class ServiceManualPhaseLabelTest < ActionDispatch::IntegrationTest stub_content_store_has_item(guide["base_path"], guide) visit guide["base_path"] - assert_text("Alpha") + phase_label = find("strong.govuk-tag.govuk-phase-banner__content__tag").text + + assert_match(/alpha/i, phase_label.strip) end test "No phase label is displayed for a guide without a phase field" do