-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3118 from alphagov/dependabot/bundler/govuk_publi…
…shing_components-35.12.0 Bump govuk_publishing_components from 35.11.0 to 35.12.0
- Loading branch information
Showing
3 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ describe('GA4 finder change tracker', function () { | |
inputParent = document.createElement('div') | ||
inputParent.setAttribute('data-ga4-change-category', 'update-filter checkbox') | ||
inputParent.setAttribute('data-ga4-section', 'Your favourite chocolate') | ||
var index = { index_section: 1, index_section_count: 1, index_link: undefined } | ||
var index = { index_section: 1, index_section_count: 1 } | ||
inputParent.setAttribute('data-ga4-index', JSON.stringify(index)) | ||
|
||
input = document.createElement('input') | ||
|
@@ -119,15 +119,15 @@ describe('GA4 finder change tracker', function () { | |
expected.event_data.section = 'Your favourite chocolate' | ||
expected.event_data.text = 'All types of chocolate' | ||
expected.event_data.action = 'select' | ||
expected.event_data.index = index | ||
expected.event_data.index = { index_section: 1, index_section_count: 1, index_link: undefined } | ||
|
||
expect(window.dataLayer[0]).toEqual(expected) | ||
|
||
input.checked = false | ||
window.GOVUK.triggerEvent(input, 'change') | ||
|
||
expected.event_data.action = 'remove' | ||
expected.event_data.index = undefined | ||
expected.event_data.index = { index_section: undefined, index_section_count: undefined, index_link: undefined } | ||
|
||
expect(window.dataLayer[1]).toEqual(expected) | ||
}) | ||
|
@@ -136,7 +136,7 @@ describe('GA4 finder change tracker', function () { | |
inputParent = document.createElement('div') | ||
inputParent.setAttribute('data-ga4-change-category', 'update-filter radio') | ||
inputParent.setAttribute('data-ga4-section', 'Your favourite chocolate') | ||
var index = { index_section: 1, index_section_count: 1, index_link: undefined } | ||
var index = { index_section: 1, index_section_count: 1 } | ||
inputParent.setAttribute('data-ga4-index', JSON.stringify(index)) | ||
|
||
option1 = document.createElement('input') | ||
|
@@ -170,7 +170,7 @@ describe('GA4 finder change tracker', function () { | |
expected.event_data.section = 'Your favourite chocolate' | ||
expected.event_data.text = 'Belgian chocolate' | ||
expected.event_data.action = 'select' | ||
expected.event_data.index = index | ||
expected.event_data.index = { index_section: 1, index_section_count: 1, index_link: undefined } | ||
|
||
expect(window.dataLayer[0]).toEqual(expected) | ||
|
||
|
@@ -179,7 +179,7 @@ describe('GA4 finder change tracker', function () { | |
window.GOVUK.triggerEvent(option1, 'change') | ||
|
||
expected.event_data.action = 'remove' | ||
expected.event_data.index = undefined | ||
expected.event_data.index = { index_section: undefined, index_section_count: undefined, index_link: undefined } | ||
expected.event_data.text = 'All types of chocolate (default)' | ||
|
||
expect(window.dataLayer[1]).toEqual(expected) | ||
|
@@ -189,7 +189,7 @@ describe('GA4 finder change tracker', function () { | |
inputParent = document.createElement('div') | ||
inputParent.setAttribute('data-ga4-change-category', 'update-filter select') | ||
inputParent.setAttribute('data-ga4-section', 'Your favourite chocolate') | ||
var index = { index_section: 5, index_section_count: 15, index_link: undefined } | ||
var index = { index_section: 5, index_section_count: 15 } | ||
inputParent.setAttribute('data-ga4-index', JSON.stringify(index)) | ||
|
||
input = document.createElement('select') | ||
|
@@ -218,15 +218,15 @@ describe('GA4 finder change tracker', function () { | |
expected.event_data.section = 'Your favourite chocolate' | ||
expected.event_data.text = 'Belgian chocolate' | ||
expected.event_data.action = 'select' | ||
expected.event_data.index = index | ||
expected.event_data.index = { index_section: 5, index_section_count: 15, index_link: undefined } | ||
|
||
expect(window.dataLayer[0]).toEqual(expected) | ||
|
||
input.value = 'all-types' | ||
window.GOVUK.triggerEvent(input, 'change') | ||
|
||
expected.event_data.action = 'remove' | ||
expected.event_data.index = undefined | ||
expected.event_data.index = { index_link: undefined, index_section: undefined, index_section_count: undefined } | ||
expected.event_data.text = 'All types of chocolate (default)' | ||
|
||
expect(window.dataLayer[1]).toEqual(expected) | ||
|
@@ -236,7 +236,7 @@ describe('GA4 finder change tracker', function () { | |
inputParent = document.createElement('div') | ||
inputParent.setAttribute('data-ga4-change-category', 'update-filter text') | ||
inputParent.setAttribute('data-ga4-section', 'Your favourite chocolate') | ||
var index = { index_section: 2, index_section_count: 2, index_link: undefined } | ||
var index = { index_section: 2, index_section_count: 2 } | ||
inputParent.setAttribute('data-ga4-index', JSON.stringify(index)) | ||
|
||
input = document.createElement('input') | ||
|
@@ -252,15 +252,15 @@ describe('GA4 finder change tracker', function () { | |
expected.event_data.section = 'Your favourite chocolate' | ||
expected.event_data.text = 'Here is an email that should not get redacted [email protected]' | ||
expected.event_data.action = 'search' | ||
expected.event_data.index = index | ||
expected.event_data.index = { index_section: 2, index_section_count: 2, index_link: undefined } | ||
|
||
expect(window.dataLayer[0]).toEqual(expected) | ||
|
||
input.value = '' | ||
window.GOVUK.triggerEvent(input, 'change') | ||
|
||
expected.event_data.action = 'remove' | ||
expected.event_data.index = undefined | ||
expected.event_data.index = { index_section: undefined, index_section_count: undefined, index_link: undefined } | ||
expected.event_data.text = undefined | ||
|
||
expect(window.dataLayer[1]).toEqual(expected) | ||
|