From f3fbda049cea11cc77fd25081551baae986c808e Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Dec 2024 12:02:51 +0000 Subject: [PATCH] Replace references to document-navigation-list in tests Featured links are now displayed using the `list` component from the govuk-publishing-components gem --- spec/features/organisation_spec.rb | 16 ++++++++-------- spec/support/courts_pages_helper.rb | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index 2d3ee8b4d..73761062d 100644 --- a/spec/features/organisation_spec.rb +++ b/spec/features/organisation_spec.rb @@ -148,18 +148,18 @@ it "does not display them if they are absent from content item" do visit "/government/organisations/prime-ministers-office-10-downing-street" expect(page).not_to have_css("section#featured-documents") - expect(page).not_to have_css(".app-c-document-navigation-list.app-c-document-navigation-list--small") + expect(page).not_to have_css(".govuk-link.govuk-link--no-underline.govuk-\\!-font-weight-bold.govuk-body-s.brand__color") end it "displays them if they are present" do visit "/government/organisations/attorney-generals-office" expect(page).to have_css("section#featured-documents") - expect(page).to have_css(".app-c-document-navigation-list.app-c-document-navigation-list--small .app-c-document-navigation-list__link", text: "Attorney General's guidance to the legal profession") + expect(page).to have_css(".gem-c-list .govuk-link.govuk-link--no-underline.govuk-\\!-font-weight-bold.govuk-body-s.brand__color", text: "Attorney General's guidance to the legal profession") visit "/government/organisations/charity-commission" expect(page).to have_css("section#featured-documents") - expect(page).to have_css(".app-c-document-navigation-list .app-c-document-navigation-list__link", text: "Find a charity") - expect(page).not_to have_css(".app-c-document-navigation-list.app-c-document-navigation-list--small") + expect(page).to have_css(".gem-c-list .govuk-link.govuk-link--no-underline.govuk-\\!-font-weight-bold", text: "Find a charity") + expect(page).not_to have_css(".govuk-link.govuk-link--no-underline.govuk-\\!-font-weight-bold.govuk-body-s.brand__color") end end @@ -352,8 +352,8 @@ visit "/government/organisations/attorney-generals-office" expect(page).to have_css("section#high-profile-groups") expect(page).to have_css(".gem-c-heading", text: "High profile groups within AGO") - expect(page).to have_css(".app-c-document-navigation-list__link[href='/government/organisations/attorney-generals-office-1']", text: "High Profile Group 1") - expect(page).to have_css(".app-c-document-navigation-list__link[href='/government/organisations/attorney-generals-office-2']", text: "High Profile Group 2") + expect(page).to have_css(".gem-c-list .govuk-link[href='/government/organisations/attorney-generals-office-1']", text: "High Profile Group 1") + expect(page).to have_css(".gem-c-list .govuk-link[href='/government/organisations/attorney-generals-office-2']", text: "High Profile Group 2") end it "does not show section for organisations without high profile groups" do @@ -382,9 +382,9 @@ visit "/government/organisations/attorney-generals-office" expect(page).to have_css("div#corporate-info") expect(page).to have_css(".gem-c-heading", text: "Corporate information") - expect(page).to have_css(".app-c-document-navigation-list__link[href='/government/organisations/attorney-generals-office/about/complaints-procedure']", text: "Complaints procedure") + expect(page).to have_css(".gem-c-list .govuk-link[href='/government/organisations/attorney-generals-office/about/complaints-procedure']", text: "Complaints procedure") expect(page).to have_css(".gem-c-heading", text: "Jobs and contracts") - expect(page).to have_css(".app-c-document-navigation-list__link[href='https://www.civilservicejobs.service.gov.uk/csr']", text: "Jobs") + expect(page).to have_css(".gem-c-list .govuk-link[href='https://www.civilservicejobs.service.gov.uk/csr']", text: "Jobs") end it "does not show corporate info pages if data is unavailable" do diff --git a/spec/support/courts_pages_helper.rb b/spec/support/courts_pages_helper.rb index 0f2bc19b9..8c2d4b242 100644 --- a/spec/support/courts_pages_helper.rb +++ b/spec/support/courts_pages_helper.rb @@ -43,7 +43,7 @@ def the_courts_title end def and_featured_links - expect(page).to have_selector(".app-c-document-navigation-list") + expect(page).to have_selector(".gem-c-list") end def and_the_what_we_do_section