Skip to content

Commit

Permalink
Replace references to document-navigation-list in tests
Browse files Browse the repository at this point in the history
Featured links are now displayed using the `list` component from the govuk-publishing-components gem
  • Loading branch information
MartinJJones committed Dec 17, 2024
1 parent 492018d commit f3fbda0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions spec/features/organisation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/courts_pages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f3fbda0

Please sign in to comment.