Skip to content

Commit

Permalink
Merge pull request #9835 from alphagov/use-heading
Browse files Browse the repository at this point in the history
Replace title component with heading
  • Loading branch information
andysellick authored Jan 27, 2025
2 parents d42ed73 + acf55da commit ecf44ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions app/views/layouts/design_system.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@
<% if yield(:title).present? %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-<%= column_width %>">
<%= render "govuk_publishing_components/components/title", {
context: yield(:context),
title: yield(:title),
margin_top: 0,
margin_bottom: yield(:title_margin_bottom).present? ? yield(:title_margin_bottom).to_i : nil,
} %>
<%
heading_options = {
context: yield(:context),
text: yield(:title),
heading_level: 1,
font_size: "xl",
}
heading_options[:margin_bottom] = yield(:title_margin_bottom).to_i if yield(:title_margin_bottom).present?
%>
<%= render "govuk_publishing_components/components/heading", heading_options %>
</div>

<% if yield(:page_full_width).blank? %>
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/document_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
end

Then(/^I should see the conflict between the (publication|policy|news article|consultation|speech) titles "([^"]*)" and "([^"]*)"$/) do |_document_type, new_title, latest_title|
expect(new_title).to eq(find(".gem-c-title__context").text)
expect(new_title).to eq(find(".govuk-caption-xl").text)
expect(page).to have_selector(".conflict h2", text: latest_title)
end

Expand Down

0 comments on commit ecf44ed

Please sign in to comment.