Skip to content

Commit

Permalink
Fix: service manual mobile/tablet alignment
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
CodeSonia committed Aug 8, 2024
1 parent fc27135 commit 2632ff7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions app/views/content_items/service_manual_topic.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<% content_for :phase_message do %>
<%= render 'shared/custom_phase_message', phase: @content_item.phase %>
<% end %>
<div class="govuk-width-container">

<%= render "govuk_publishing_components/components/breadcrumbs", {
breadcrumbs: @content_item.breadcrumbs,
Expand Down Expand Up @@ -89,4 +88,3 @@
</div>

</div>
</div>
2 changes: 0 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
<%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase %>
<% end %>
<% if @content_item.service_manual? %>
<div class="govuk-width-container">
<%= render_phase_label @content_item, content_for(:phase_message) %>
</div>
<% end %>

<% if @content_item.show_default_breadcrumbs? %>
Expand Down
4 changes: 3 additions & 1 deletion test/integration/service_manual_phase_label_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2632ff7

Please sign in to comment.