diff --git a/app/assets/stylesheets/views/_travel-advice.scss b/app/assets/stylesheets/views/_travel-advice.scss index 286dee1ba..fe30f9c92 100644 --- a/app/assets/stylesheets/views/_travel-advice.scss +++ b/app/assets/stylesheets/views/_travel-advice.scss @@ -18,3 +18,8 @@ } } } + +.metadata__update { + display: block; + margin-bottom: govuk-spacing(2); +} diff --git a/app/presenters/travel_advice_presenter.rb b/app/presenters/travel_advice_presenter.rb index 725d2e27a..c9e182bd9 100644 --- a/app/presenters/travel_advice_presenter.rb +++ b/app/presenters/travel_advice_presenter.rb @@ -20,7 +20,7 @@ def metadata I18n.t("travel_advice.updated") => display_date(reviewed_at || updated_at), } - other["Latest update"] = view_context.simple_format(latest_update) if latest_update.present? + other["Latest update"] = view_context.simple_format(latest_update, { class: "metadata__update" }, wrapper_tag: "span") if latest_update.present? { other: other, diff --git a/test/presenters/travel_advice_presenter_test.rb b/test/presenters/travel_advice_presenter_test.rb index 303562e09..168a643c7 100644 --- a/test/presenters/travel_advice_presenter_test.rb +++ b/test/presenters/travel_advice_presenter_test.rb @@ -240,10 +240,11 @@ def schema_name test "metadata avoids duplication of 'Latest update' from change description" do [ - { original: "Latest update: Changes", presented: "

Changes

" }, - { original: "Latest update - changes", presented: "

Changes

" }, - { original: "Latest update changes", presented: "

Changes

" }, - { original: "Latest Update: Summary of changes. Next sentence", presented: "

Summary of changes. Next sentence

" }, + { original: "Latest update: Changes", presented: "Changes" }, + { original: "Latest update - changes", presented: "Changes" }, + { original: "Latest update changes", presented: "Changes" }, + { original: "Latest Update: Summary of changes. Next sentence", presented: "Summary of changes. Next sentence" }, + { original: "Latest update: Changes\n\nMore changes", presented: "Changes\n\nMore changes" }, ].each do |i| assert_equal i[:presented], present_latest(i[:original]) end