diff --git a/Gemfile b/Gemfile index 4c6f8fb72..f96bf3cbb 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,6 @@ gem 'gds-api-adapters', '~> 52.2' gem 'govuk_ab_testing', '~> 2.4' gem 'govuk_app_config', '~> 1.3' gem 'govuk_frontend_toolkit', '~> 7.4' -gem 'govuk_navigation_helpers', '~> 9.2.1' gem 'govuk_publishing_components', '~> 5.7.0' gem 'plek', '~> 2.1' gem 'slimmer', '~> 12.0' diff --git a/Gemfile.lock b/Gemfile.lock index 24188cbda..b5e318235 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -365,7 +365,6 @@ DEPENDENCIES govuk_ab_testing (~> 2.4) govuk_app_config (~> 1.3) govuk_frontend_toolkit (~> 7.4) - govuk_navigation_helpers (~> 9.2.1) govuk_publishing_components (~> 5.7.0) govuk_schemas (~> 3.1) htmlentities (~> 4.3) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 779dd451e..f6bea3122 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -15,7 +15,6 @@ @import 'helpers/organisation-links'; @import 'helpers/parts'; @import 'helpers/add-title-margin'; -@import "helpers/step-by-step-nav-title"; @import "helpers/content-bottom-margin"; @import "helpers/publisher-metadata-with-logo"; diff --git a/app/assets/stylesheets/helpers/_step-by-step-nav-title.scss b/app/assets/stylesheets/helpers/_step-by-step-nav-title.scss deleted file mode 100644 index 479d96f08..000000000 --- a/app/assets/stylesheets/helpers/_step-by-step-nav-title.scss +++ /dev/null @@ -1,7 +0,0 @@ -.step-by-step-nav-sidebar { - margin-bottom: 0; - - @include media(tablet) { - margin-top: 180px; - } -} diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0459e0862..8ab91e0fc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,11 +7,6 @@ class ApplicationController < ActionController::Base private - def step_nav_helper - @step_nav_helpers ||= GovukPublishingComponents::StepNavHelper.new(content_item.content_item, request.path) - end - helper_method :step_nav_helper - def content_item_path path_and_optional_locale = params .values_at(:path, :locale) diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb index f448009cc..04e7219b6 100644 --- a/app/controllers/content_items_controller.rb +++ b/app/controllers/content_items_controller.rb @@ -15,7 +15,6 @@ class ContentItemsController < ApplicationController def show load_content_item - set_up_navigation set_expiry set_access_control_allow_origin_header if request.format.atom? set_guide_draft_access_token if @content_item.is_a?(GuidePresenter) @@ -89,10 +88,6 @@ def set_expiry expires_in(max_age, public: !cache_private) end - def set_up_navigation - @navigation = NavigationType.new(@content_item.content_item) - end - def with_locale I18n.with_locale(@content_item.locale || I18n.default_locale) { yield } end diff --git a/app/models/navigation_type.rb b/app/models/navigation_type.rb deleted file mode 100644 index 15ef1706c..000000000 --- a/app/models/navigation_type.rb +++ /dev/null @@ -1,28 +0,0 @@ -class NavigationType - GUIDANCE_SCHEMAS = - %w{answer contact guide detailed_guide document_collection publication}.freeze - - def initialize(content_item) - @content_item = content_item - end - - def should_present_taxonomy_navigation? - !content_is_tagged_to_browse_pages? && - content_is_tagged_to_a_live_taxon? && - content_schema_is_guidance? - end - -private - - def content_is_tagged_to_a_live_taxon? - @content_item.dig("links", "taxons").to_a.any? { |taxon| taxon["phase"] == "live" } - end - - def content_is_tagged_to_browse_pages? - @content_item.dig("links", "mainstream_browse_pages").present? - end - - def content_schema_is_guidance? - GUIDANCE_SCHEMAS.include? @content_item["schema_name"] - end -end diff --git a/app/presenters/contact_presenter.rb b/app/presenters/contact_presenter.rb index c63cddb72..73f2c0a59 100644 --- a/app/presenters/contact_presenter.rb +++ b/app/presenters/contact_presenter.rb @@ -8,27 +8,6 @@ def title_and_context end end - def related_items - sections = [] - if quick_links.any? - sections << { - title: "Elsewhere on GOV.UK", - items: quick_links - } - end - - if related_contacts_links.any? - sections << { - title: "Other contacts", - items: related_contacts_links - } - end - - { - sections: sections - } - end - def online_form_links contact_form_links = content_item["details"]["contact_form_links"] || [] contact_form_links.map do |link| @@ -112,30 +91,6 @@ def webchat_open_url "https://www.tax.service.gov.uk/csp-partials/open/#{webchat_id}" end - def breadcrumbs - return [] if content_item["links"]['organisations'].try(:length) != 1 - - org = content_item["links"]['organisations'].first - title = org['title'] - base = org['base_path'] - contact_url = "#{base}/contact" - - [ - { - title: "Home", - url: "/", - }, - { - title: title, - url: base, - }, - { - title: "Contact #{title}", - url: contact_url, - } - ] - end - private def phone_numbers_in_group(group) diff --git a/app/presenters/content_item_presenter.rb b/app/presenters/content_item_presenter.rb index 28c469035..d92045d10 100644 --- a/app/presenters/content_item_presenter.rb +++ b/app/presenters/content_item_presenter.rb @@ -22,7 +22,6 @@ def initialize(content_item, requested_content_item_path = nil) @locale = content_item["locale"] || "en" @phase = content_item["phase"] @document_type = content_item["document_type"] - @nav_helper = GovukNavigationHelpers::NavigationHelper.new(content_item) @part_slug = requesting_a_part? ? requested_content_item_path.split('/').last : nil end @@ -50,26 +49,6 @@ def content_id content_item["content_id"] end - def breadcrumbs - @nav_helper.breadcrumbs[:breadcrumbs] - end - - def taxon_breadcrumbs - @nav_helper.taxon_breadcrumbs[:breadcrumbs] - end - - def taxonomy_sidebar - @nav_helper.taxonomy_sidebar - end - - def related_items - @nav_helper.related_items - end - - def tagged_to_a_taxon? - content_item.dig("links", "taxons").present? - end - private def display_date(timestamp, format = "%-d %B %Y") diff --git a/app/presenters/guide_presenter.rb b/app/presenters/guide_presenter.rb index 82813483a..9b008bbdb 100644 --- a/app/presenters/guide_presenter.rb +++ b/app/presenters/guide_presenter.rb @@ -34,10 +34,6 @@ def print_link "#{base_path}/print" end - def related_items - @nav_helper.related_items - end - # Append token parameters to part paths to allow fact-checkers to fact-check all pages def parts if draft_access_token diff --git a/app/presenters/specialist_document_presenter.rb b/app/presenters/specialist_document_presenter.rb index 6cbeedea5..66daf08da 100644 --- a/app/presenters/specialist_document_presenter.rb +++ b/app/presenters/specialist_document_presenter.rb @@ -32,21 +32,6 @@ def important_metadata end end - def breadcrumbs - return [] unless finder - - [ - { - title: "Home", - url: "/", - }, - { - title: finder['title'], - url: finder['base_path'], - } - ] - end - def continuation_link content_item .dig("details", "metadata", "continuation_link") diff --git a/app/presenters/topical_event_about_page_presenter.rb b/app/presenters/topical_event_about_page_presenter.rb index 0590ef596..1848c01e5 100644 --- a/app/presenters/topical_event_about_page_presenter.rb +++ b/app/presenters/topical_event_about_page_presenter.rb @@ -3,32 +3,10 @@ class TopicalEventAboutPagePresenter < ContentItemPresenter include ContentItem::ContentsList include ContentItem::TitleAndContext - # Old topical event pages have a "archived" string appended to their title - # which we also include in the breadcrumbs of topical event about pages - # for example: https://www.gov.uk/government/topical-events/ebola-virus-government-response/about - def breadcrumbs - result = super - result.last[:title] = parent['title'] if parent - result - end - def title_and_context super.tap do |t| t.delete(:average_title_length) t.delete(:context) end end - -private - - def parent - return nil unless super - topical_event_end_date = super.dig("details", "end_date") - - if topical_event_end_date && Time.zone.parse(topical_event_end_date) <= Time.zone.today - super.merge("title" => "#{super['title']} (Archived)") - else - super - end - end end diff --git a/app/presenters/travel_advice_presenter.rb b/app/presenters/travel_advice_presenter.rb index 7ade08374..c8486d094 100644 --- a/app/presenters/travel_advice_presenter.rb +++ b/app/presenters/travel_advice_presenter.rb @@ -37,24 +37,6 @@ def country_name content_item["details"]["country"]["name"] end - def related_items - items = ordered_related_items.map do |link| - { - title: link["title"], - url: link["base_path"] - } - end - - { - sections: [ - { - title: 'Elsewhere on GOV.UK', - items: items - } - ] - } - end - def is_summary? @part_slug.nil? end @@ -127,10 +109,6 @@ def summary_part } end - def ordered_related_items - content_item["links"]["ordered_related_items"] || [] - end - def change_description content_item['details']['change_description'] end diff --git a/app/views/content_items/_body_with_related_links.html.erb b/app/views/content_items/_body_with_related_links.html.erb index fa8500966..f1442c309 100644 --- a/app/views/content_items/_body_with_related_links.html.erb +++ b/app/views/content_items/_body_with_related_links.html.erb @@ -23,5 +23,5 @@ <% end %> - <%= render 'shared/sidebar_navigation', local_assigns %> + <%= render 'shared/sidebar_navigation' %> diff --git a/app/views/content_items/contact.html.erb b/app/views/content_items/contact.html.erb index 71cf8b9de..42a31f619 100644 --- a/app/views/content_items/contact.html.erb +++ b/app/views/content_items/contact.html.erb @@ -3,6 +3,11 @@
To use this service, you need to create either a Government Gateway or GOV.UK Verify account. These are used to help fight identity theft.
Once you have an account, you can use it to access other government services online.
Registering with Government Gateway usually takes about 10 minutes. It works best if you have:
Create a Government Gateway account.
Registering with GOV.UK Verify usually takes about 15 minutes. It works best if you have:
Create a GOV.UK Verify account.
A certified company will double check your identity when you register with GOV.UK Verify. They’ve all met security standards set by government.
Signing in for the first time will activate your personal tax account. You can use this to check your HMRC records and manage your other details.
") assert page.has_css?('meta[name="robots"][content="noindex, nofollow"]', visible: false) - refute page.has_css?(shared_component_selector('breadcrumbs')) refute page.has_css?(shared_component_selector('government_navigation')) assert page.has_css?( diff --git a/test/integration/service_sign_in/verify_hub_trial_create_new_account_test.rb b/test/integration/service_sign_in/verify_hub_trial_create_new_account_test.rb index ede227219..d15d01bf5 100644 --- a/test/integration/service_sign_in/verify_hub_trial_create_new_account_test.rb +++ b/test/integration/service_sign_in/verify_hub_trial_create_new_account_test.rb @@ -51,7 +51,6 @@ class VerifyHubTrialCreateNewAccount < ActionDispatch::IntegrationTest assert_has_component_govspeak("To use this service, you need to create either a Government Gateway or GOV.UK Verify account. These are used to help fight identity theft.
Once you have an account, you can use it to access other government services online.
Registering with Government Gateway usually takes about 10 minutes. It works best if you have:
Create a Government Gateway account.
Registering with GOV.UK Verify usually takes about 15 minutes. It works best if you have:
Create a GOV.UK Verify account.
A certified company will double check your identity when you register with GOV.UK Verify. They’ve all met security standards set by government.
Signing in for the first time will activate your personal tax account. You can use this to check your HMRC records and manage your other details.
") assert page.has_css?('meta[name="robots"][content="noindex, nofollow"]', visible: false) - refute page.has_css?(shared_component_selector('breadcrumbs')) refute page.has_css?(shared_component_selector('government_navigation')) assert page.has_css?( diff --git a/test/integration/speech_test.rb b/test/integration/speech_test.rb index ae1a223eb..941a7546c 100644 --- a/test/integration/speech_test.rb +++ b/test/integration/speech_test.rb @@ -40,19 +40,4 @@ class SpeechTest < ActionDispatch::IntegrationTest assert_footer_has_published_dates("Published 8 March 2016") end - - test "renders related policy links" do - setup_and_visit_content_item('speech-transcript') - - assert_has_related_navigation( - section_name: "related-nav-policies", - section_text: "Policy", - links: { - "Government transparency and accountability": - "/government/policies/government-transparency-and-accountability", - "Tax evasion and avoidance": - "/government/policies/tax-evasion-and-avoidance" - } - ) - end end diff --git a/test/integration/statistical_data_set_test.rb b/test/integration/statistical_data_set_test.rb index 3f3155e09..a0118aca6 100644 --- a/test/integration/statistical_data_set_test.rb +++ b/test/integration/statistical_data_set_test.rb @@ -20,22 +20,6 @@ class StatisticalDataSetTest < ActionDispatch::IntegrationTest assert_footer_has_published_dates("Published 13 December 2012") end - test "render related side bar navigation" do - setup_and_visit_content_item('statistical_data_set') - assert_has_related_navigation( - [ - { - section_name: "related-nav-collections", - section_text: "Collection", - links: { - "Transport Statistics Great Britain": - "/government/collections/transport-statistics-great-britain" - } - }, - ] - ) - end - test "renders withdrawn notification" do setup_and_visit_content_item("statistical_data_set_withdrawn") diff --git a/test/integration/topical_event_about_page_test.rb b/test/integration/topical_event_about_page_test.rb index 17d3f1ef3..bf188cc70 100644 --- a/test/integration/topical_event_about_page_test.rb +++ b/test/integration/topical_event_about_page_test.rb @@ -17,33 +17,6 @@ class TopicalEventAboutPageTest < ActionDispatch::IntegrationTest ]) end - test "breadcrumbs show whether a topical event is archived" do - @content_item = get_content_example("topical_event_about_page") - content_store_has_item(@content_item["base_path"], @content_item.to_json) - - breadcrumbs = [ - { - title: "Home", - url: "/" - }, - { - title: @content_item["links"]["parent"][0]["title"], - url: @content_item["links"]["parent"][0]["base_path"] - }, - ] - - travel_to(topical_event_end_date - 1) do - visit @content_item["base_path"] - assert_has_component_breadcrumbs(breadcrumbs) - end - - travel_to(topical_event_end_date) do - visit @content_item["base_path"] - breadcrumbs[1][:title] = @content_item["links"]["parent"][0]["title"] + " (Archived)" - assert_has_component_breadcrumbs(breadcrumbs) - end - end - test "slim topical event about pages have no contents" do setup_and_visit_content_item('slim') refute page.has_css?('.contents-list.contents-list-dashed') diff --git a/test/integration/world_location_news_article_test.rb b/test/integration/world_location_news_article_test.rb index ff3b1279d..515004b23 100644 --- a/test/integration/world_location_news_article_test.rb +++ b/test/integration/world_location_news_article_test.rb @@ -21,23 +21,6 @@ class WorldLocationNewsArticleTest < ActionDispatch::IntegrationTest assert_footer_has_published_dates("Published 24 November 2015") end - test "renders organisation and location links" do - setup_and_visit_content_item('world_location_news_article') - - assert_has_publisher_metadata(metadata: { - "From": { - "British High Commission Nairobi": - "/government/world/organisations/british-high-commission-nairobi" - } - }) - - assert_has_related_navigation( - section_name: "related-nav-world_locations", - section_text: "World locations", - links: { "Kenya": "/world/kenya/news" } - ) - end - test "renders translation links when there is more than one translation" do setup_and_visit_content_item("world_location_news_article_with_multiple_translations") diff --git a/test/presenters/contact_presenter_test.rb b/test/presenters/contact_presenter_test.rb index 04b4dfaa7..0ab622830 100644 --- a/test/presenters/contact_presenter_test.rb +++ b/test/presenters/contact_presenter_test.rb @@ -10,31 +10,6 @@ def schema_name assert_equal schema_item['title'], presented_item.title end - test 'only presents related item sections when section has items' do - schema = schema_item('contact_with_email_and_no_other_contacts') - presented = presented_item('contact_with_email_and_no_other_contacts') - - refute schema['links']['related'] - other_contacts_section = presented.related_items[:sections].select { |section| section[:title] == 'Other contacts' } - assert_empty other_contacts_section - end - - test 'presents quick links in related items' do - first_quick_link = schema_item['details']['quick_links'].first - first_presented_quick_link = presented_item.related_items[:sections].first[:items].first - - assert_equal first_quick_link['title'], first_presented_quick_link[:title] - assert_equal 'Elsewhere on GOV.UK', presented_item.related_items[:sections].first[:title] - end - - test 'presents related contacts links in related items' do - first_related_contact_link = schema_item['links']['related'].first - first_presented_contact_link = presented_item.related_items[:sections].last[:items].first - - assert_equal first_related_contact_link['title'], first_presented_contact_link[:title] - assert_equal 'Other contacts', presented_item.related_items[:sections].last[:title] - end - test 'presents online form links' do assert_equal schema_item['details']['contact_form_links'].first['link'], presented_item.online_form_links.first[:url] end @@ -109,47 +84,6 @@ def schema_name assert_nil present_example(example).online_form_body end - test 'breadcrumbs' do - assert_equal [ - { - title: "Home", - url: "/" - }, - { - title: "HM Revenue & Customs", - url: "/government/organisations/hm-revenue-customs" - }, - { - title: "Contact HM Revenue & Customs", - url: "/government/organisations/hm-revenue-customs/contact" - } - ], presented_item.breadcrumbs - end - - test 'no breadcrumbs render with no organisations' do - schema = schema_item('contact') - schema["links"]["organisations"] = [] - - assert_equal [], present_example(schema).breadcrumbs - end - - test 'no breadcrumbs render with no organisations set' do - schema = schema_item('contact') - schema["links"].delete("organisations") - assert_equal [], present_example(schema).breadcrumbs - end - - test 'no breadcrumbs render with two organisations' do - schema = schema_item('contact') - two_orgs = [ - schema["links"]["organisations"], - schema["links"]["organisations"] - ].flatten - - schema["links"]["organisations"] = two_orgs - assert_equal [], present_example(schema).breadcrumbs - end - test 'presents webchat' do schema = schema_item('contact_with_webchat') presented = present_example(schema) diff --git a/test/presenters/content_item_presenter_test.rb b/test/presenters/content_item_presenter_test.rb index 8131d9d31..68835adfb 100644 --- a/test/presenters/content_item_presenter_test.rb +++ b/test/presenters/content_item_presenter_test.rb @@ -21,15 +21,6 @@ class ContentItemPresenterTest < ActiveSupport::TestCase assert_equal "Type", ContentItemPresenter.new("document_type" => "Type").document_type end - test "#taxonomy_sidebar combines taxonomy links and collections links for the taxonomy sidebar component" do - GovukNavigationHelpers::NavigationHelper.any_instance - .stubs(:taxonomy_sidebar) - .returns(items: :some_taxonomy_data, collections: :some_collections_data) - - expected = { items: :some_taxonomy_data, collections: :some_collections_data } - assert_equal expected, ContentItemPresenter.new("schema_name" => "Schema name").taxonomy_sidebar - end - test "available_translations sorts languages by locale with English first" do translated = govuk_content_schema_example('case_study', 'translated') locales = ContentItemPresenter.new(translated).available_translations diff --git a/test/presenters/detailed_guide_presenter_test.rb b/test/presenters/detailed_guide_presenter_test.rb index b324054df..efee9f394 100644 --- a/test/presenters/detailed_guide_presenter_test.rb +++ b/test/presenters/detailed_guide_presenter_test.rb @@ -21,19 +21,6 @@ def schema_name assert_equal '12 June 2014', presented_item.published end - test 'breadcrumbs show the full parent hierarchy' do - assert_equal "Home", presented_item.breadcrumbs[0][:title] - assert_equal "/", presented_item.breadcrumbs[0][:url] - assert_equal "Business tax", presented_item.breadcrumbs[1][:title] - assert_equal "/topic/business-tax", presented_item.breadcrumbs[1][:url] - assert_equal "PAYE", presented_item.breadcrumbs[2][:title] - assert_equal "/topic/business-tax/paye", presented_item.breadcrumbs[2][:url] - end - - test 'the "home" link shows if there is no parent' do - assert_equal [{ title: "Home", url: "/" }], presented_item("withdrawn_detailed_guide").breadcrumbs - end - test 'presents withdrawn notices' do example = schema_item("withdrawn_detailed_guide") presented = presented_item("withdrawn_detailed_guide") diff --git a/test/presenters/specialist_document_presenter_test.rb b/test/presenters/specialist_document_presenter_test.rb index f8e25a5f2..d2f3be42d 100644 --- a/test/presenters/specialist_document_presenter_test.rb +++ b/test/presenters/specialist_document_presenter_test.rb @@ -310,19 +310,6 @@ def example_facet(overrides = {}) assert_equal expected_order, present_example(example).important_metadata.keys end - test 'breadcrumbs' do - assert_equal [ - { - title: "Home", - url: "/" - }, - { - title: "Finder title", - url: "/finder-base-path" - } - ], present_example(example_with_finder_facets).breadcrumbs - end - test 'sends an error notification when there is no finder' do example = schema_item('aaib-reports') example['links']['finder'] = [] @@ -335,15 +322,6 @@ def example_facet(overrides = {}) present_example(example).important_metadata end - test 'no breadcrumbs render with no finder' do - example = schema_item('aaib-reports') - example['links']['finder'] = [] - assert_equal [], present_example(example).breadcrumbs - - example['links'].delete('finder') - assert_equal [], present_example(example).breadcrumbs - end - test 'omits first_published_at facet values from `other` section of component parameters to avoid duplicates' do facets = [ { diff --git a/test/presenters/topical_event_about_page_presenter_test.rb b/test/presenters/topical_event_about_page_presenter_test.rb index 3cc22dc61..575d79ae9 100644 --- a/test/presenters/topical_event_about_page_presenter_test.rb +++ b/test/presenters/topical_event_about_page_presenter_test.rb @@ -26,36 +26,4 @@ def schema_name test 'presents no contents when no headings in the body' do assert_equal [], presented_item('slim').contents end - - test 'presents a breadcrumb and indicates the archive state of the parent topical event' do - breadcrumbs = [ - { title: "Home", url: "/" }, - { title: "Ebola virus: UK government response", url: "/government/topical-events/ebola-virus-government-response" } - ] - - travel_to(topical_event_end_date - 1) do - assert_equal breadcrumbs, presented_item.breadcrumbs - end - - travel_to(topical_event_end_date) do - breadcrumbs[1][:title] = "Ebola virus: UK government response (Archived)" - assert_equal breadcrumbs, presented_item.breadcrumbs - end - end - - test 'presents a breadcrumb if parent topic event has no end date' do - breadcrumbs = [ - { title: "Home", url: "/" }, - { title: "Battle of the Somme Centenary", url: "/government/topical-events/battle-of-the-somme-centenary-commemorations" } - ] - - refute schema_item('slim')['links']['parent'][0]['details']['end_date'] - assert_equal breadcrumbs, presented_item('slim').breadcrumbs - end - -private - - def topical_event_end_date - Date.parse(schema_item['links']['parent'][0]['details']['end_date']) - end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 4a6724e9f..47287a57a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -96,12 +96,6 @@ def within_component_govspeak end end - def assert_has_component_breadcrumbs(breadcrumbs) - within shared_component_selector("breadcrumbs") do - assert_equal breadcrumbs, JSON.parse(page.text).deep_symbolize_keys.fetch(:breadcrumbs) - end - end - def assert_has_component_organisation_logo(logo, index = 1) within(shared_component_selector("organisation_logo") + ":nth-of-type(#{index})") do assert_equal logo, JSON.parse(page.text).deep_symbolize_keys @@ -182,33 +176,6 @@ def assert_footer_has_published_dates(published = nil, last_updated = nil, histo assert_has_published_dates(published, last_updated, history_link, 1) end - def assert_has_related_navigation_section_and_links(section_name, section_text, links) - unless section_name == "related-nav-related_items" - find("h3[id^='#{section_name}']", text: section_text) - end - - within("nav[aria-labelledby^='#{section_name}']") do - links.each do |text, href| - assert page.has_link?(text, href: href), - "Related navigation link '#{text}' not found in '#{section_text}' links" - end - end - end - - def assert_has_related_navigation(sections) - within(".gem-c-related-navigation") do - assert page.has_css?(".gem-c-related-navigation__main-heading", text: "Related content"), - "Related navigation 'Related content' section not found" - - sections = [sections] unless sections.is_a?(Array) - sections.each do |section| - assert_has_related_navigation_section_and_links( - section[:section_name], section[:section_text], section[:links] - ) - end - end - end - def has_component_metadata(key, value) assert page.has_css? "meta[#{key}=\"#{value}\"]", visible: false end