Skip to content

Commit

Permalink
Update feature tests when checking for page titles
Browse files Browse the repository at this point in the history
As we are now using the heading component from the gem, page titles have the `gem-c-heading__text` class
  • Loading branch information
MartinJJones committed Jan 9, 2025
1 parent 447240f commit 4f50a4a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spec/features/content_store_organisations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
end

scenario "renders page title" do
expect(page.has_css?(".gem-c-title__text", text: organisations_content_hash[:title])).to be(true)
expect(page.has_css?(".gem-c-heading__text", text: organisations_content_hash[:title])).to be(true)
end

scenario "has autodiscovery links to the API" do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/ministers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end

scenario "renders page title" do
expect(page).to have_selector(".gem-c-title__text", text: I18n.t("ministers.title"))
expect(page).to have_selector(".gem-c-heading__text", text: I18n.t("ministers.title"))
end

scenario "renders the lead paragraph with anchor links" do
Expand Down
3 changes: 1 addition & 2 deletions spec/features/step_nav_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
end

it "renders the title" do
expect(page).to have_selector(".gem-c-title")
expect(page).to have_selector(".gem-c-title__text", text: "Learn to drive a car: step by step")
expect(page).to have_selector(".gem-c-heading__text", text: "Learn to drive a car: step by step")
end

it "renders the step by step navigation component" do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/world_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
end

scenario "renders the page title" do
expect(page).to have_selector(".gem-c-title__text", text: "Help and services around the world")
expect(page).to have_selector(".gem-c-heading__text", text: "Help and services around the world")
end

scenario "renders a link to all foreign office posts" 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 @@ -39,7 +39,7 @@ def the_correct_title

def the_courts_title
expect(page).to have_title("#{@title} - GOV.UK")
expect(page).to have_selector(".gem-c-title__text", text: @title)
expect(page).to have_selector(".gem-c-heading__text", text: @title)
end

def and_featured_links
Expand Down

0 comments on commit 4f50a4a

Please sign in to comment.