Skip to content

Commit

Permalink
Update relevant tests to be aware of new world without specialist topics
Browse files Browse the repository at this point in the history
New scenario was created but left disabled due to test functionality issues
blocking delivery. This specific part of removing specialist topics from
the components gem needs to be completed to unblock other work.

Actual functionality looks correct.
  • Loading branch information
Tetrino committed Mar 18, 2024
1 parent f1a03ea commit 1fc76cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 32 deletions.
16 changes: 8 additions & 8 deletions spec/components/contextual_footer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,40 @@ def component_name
it "sets the GA4 type to \"contextual footer\"" do
content_item = {}
content_item["links"] = {
"taxons" => [
"topical_events" => [
{
"base_path" => "/skating",
"title" => "Skating",
"document_type" => "taxon",
"document_type" => "topical_event",
},
{
"base_path" => "/paragliding",
"title" => "Paragliding",
"document_type" => "taxon",
"document_type" => "topical_event",
},
],
}

render_component(content_item:)

assert_select ".gem-c-related-navigation[data-module='gem-track-click ga4-link-tracker']"
assert_select ".gem-c-related-navigation__section-link[data-ga4-link='{\"event_name\":\"navigation\",\"type\":\"contextual footer\",\"index_section\":\"1\",\"index_link\":\"1\",\"index_section_count\":\"1\",\"index_total\":\"2\",\"section\":\"Explore the topic\"}']", text: "Skating"
assert_select ".gem-c-related-navigation__section-link[data-ga4-link='{\"event_name\":\"navigation\",\"type\":\"contextual footer\",\"index_section\":\"1\",\"index_link\":\"2\",\"index_section_count\":\"1\",\"index_total\":\"2\",\"section\":\"Explore the topic\"}']", text: "Paragliding"
assert_select ".gem-c-related-navigation__section-link[data-ga4-link='{\"event_name\":\"navigation\",\"type\":\"contextual footer\",\"index_section\":\"1\",\"index_link\":\"1\",\"index_section_count\":\"1\",\"index_total\":\"2\",\"section\":\"Topical events\"}']", text: "Skating"
assert_select ".gem-c-related-navigation__section-link[data-ga4-link='{\"event_name\":\"navigation\",\"type\":\"contextual footer\",\"index_section\":\"1\",\"index_link\":\"2\",\"index_section_count\":\"1\",\"index_total\":\"2\",\"section\":\"Topical events\"}']", text: "Paragliding"
end

it "allows GA4 to be disabled" do
content_item = {}
content_item["links"] = {
"taxons" => [
"topical_events" => [
{
"base_path" => "/skating",
"title" => "Skating",
"document_type" => "taxon",
"document_type" => "topical_event",
},
{
"base_path" => "/paragliding",
"title" => "Paragliding",
"document_type" => "taxon",
"document_type" => "topical_event",
},
],
}
Expand Down
24 changes: 0 additions & 24 deletions spec/features/contextual_navigation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@
and_i_see_the_other_step_by_step_as_an_also_part_of_list
end

scenario "There's a mainstream browse page with a browse parent" do
given_theres_a_browse_page_with_a_browse_parent
and_i_visit_that_page
then_i_see_both_browse_pages_in_the_footer
and_the_default_breadcrumbs
end

scenario "Foreign travel advice content" do
given_theres_a_travel_advice_page
and_i_visit_that_page
Expand Down Expand Up @@ -241,15 +234,6 @@ def given_there_are_three_related_to_step_nav_and_one_secondary_to_step_nav
})
end

def given_theres_a_browse_page_with_a_browse_parent
content_store_has_random_item(
links: {
"parent" => [top_level_mainstream_browse_page],
"mainstream_browse_pages" => [example_item("mainstream_browse_page", "root_page")],
},
)
end

def given_theres_a_travel_advice_page
content_store_has_random_item(
schema: "travel_advice",
Expand Down Expand Up @@ -399,14 +383,6 @@ def and_i_dont_see_the_secondary_step_by_step_in_the_also_part_of_list
end
end

def then_i_see_both_browse_pages_in_the_footer
within ".gem-c-contextual-footer" do
expect(page).to have_selector(".gem-c-related-navigation")
expect(page).to have_content("Browse")
expect(page).to have_content("Benefits")
end
end

def then_i_see_the_browse_page_in_the_footer
within ".gem-c-contextual-footer" do
expect(page).to have_selector(".gem-c-related-navigation")
Expand Down

0 comments on commit 1fc76cf

Please sign in to comment.