Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Brexit notice #1830

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/presenters/content_item/no_deal_notice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ def no_deal_notice_links
end

def no_deal_notice_title
"The UK has left the EU and the transition period after Brexit comes to an end this year."
"New rules for January 2021"
end

def no_deal_notice_description
"This page tells you what you'll need to do from 1 January 2021. It will be updated if anything changes."
["The UK has left the EU, and the transition period after Brexit comes to an end this year.",
"This page tells you what you'll need to do from 1 January 2021. It will be updated if anything changes."]
end

def no_deal_notice_link_intro
Expand Down
8 changes: 7 additions & 1 deletion app/views/components/_header-notice.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
</div>

<div class="app-c-header-notice__content">
<p class="app-c-header-notice__text govuk-body"><%= description %></p>
<% if description.is_a? Array %>
<% description.map do |line| %>
<p class="app-c-header-notice__text govuk-body"><%= line %></p>
<% end %>
<% else %>
<p class="app-c-header-notice__text govuk-body"><%= description %></p>
<% end %>
<% if links.any? %>
<div class="app-c-header-notice__links">
<% if links.count == 1 %>
Expand Down
8 changes: 8 additions & 0 deletions test/components/header_notice_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ def component_name
assert_select ".app-c-header-notice__content p", text: "This is some important information about the content."
end

test "renders a header notice with text correctly with a multi-line description" do
render_component(title: "This is an important notice", description: ["This is some important information about the content.", "It runs on to two lines."])

assert_select ".app-c-header-notice__title", text: "This is an important notice"
assert_select ".app-c-header-notice__content p", text: "This is some important information about the content."
assert_select ".app-c-header-notice__content p", text: "It runs on to two lines."
end

test "renders a header notice with an aria label" do
render_component(title: "This is an important notice", description: "This is some important information about the content.")
assert_select "section[aria-label=notice]"
Expand Down