Skip to content

Commit

Permalink
Update GA4 tests to account for removal of popular in super nav
Browse files Browse the repository at this point in the history
  • Loading branch information
hannalaakso committed Mar 14, 2024
1 parent 506d7fc commit 13b8564
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions spec/components/layout_super_navigation_header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,11 @@ def component_name
render_component({ ga4_tracking: true })

assert_select "header[data-module='gem-track-click ga4-event-tracker ga4-link-tracker']"
assert_select "a[data-ga4-link]", count: 29
assert_select "a[data-ga4-link]", count: 23
assert_select 'a[data-ga4-link=\'{"event_name":"navigation","type":"header menu bar","external":"false","text":"GOV.UK","section":"Logo","index_link":1,"index_section":0,"index_section_count":2,"index_total":1}\']'
assert_select 'a[data-ga4-link=\'{"event_name":"navigation","type":"header menu bar","index_section":1,"index_link":1,"index_section_count":4,"index_total":16,"section":"Services and information"}\']'
assert_select 'a[data-ga4-link=\'{"event_name":"navigation","type":"header menu bar","index_section":1,"index_link":16,"index_section_count":4,"index_total":16,"section":"Services and information"}\']'
assert_select 'a[data-ga4-link=\'{"event_name":"navigation","type":"header menu bar","index_section":2,"index_link":1,"index_section_count":4,"index_total":6,"section":"Government activity"}\']'
assert_select 'a[data-ga4-link=\'{"event_name":"navigation","type":"header menu bar","index_section":2,"index_link":6,"index_section_count":4,"index_total":6,"section":"Government activity"}\']'
assert_select 'a[data-ga4-link=\'{"event_name":"navigation","type":"header menu bar","index_section":4,"index_link":1,"index_section_count":4,"index_total":6,"section":"Popular on GOV.UK"}\']'
assert_select 'a[data-ga4-link=\'{"event_name":"navigation","type":"header menu bar","index_section":4,"index_link":5,"index_section_count":4,"index_total":6,"section":"Popular on GOV.UK"}\']'
end
end

0 comments on commit 13b8564

Please sign in to comment.