Skip to content

Commit

Permalink
PXBF-1548-update-gtm-e2e-tests: updated dataLayer test
Browse files Browse the repository at this point in the history
  • Loading branch information
scottqueen-bixal committed Jul 23, 2024
1 parent 6d4ba04 commit 54a9919
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions benefit-finder/cypress/e2e/storybook/dataLayer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,22 +461,23 @@ describe('Calls to Google Analytics Object', function () {
removeID(ev[0])

expect(ev[0]).to.deep.equal(dataLayerValueAccordionOpen)
cy.wait(wait).then(() => {
pageObjects
.benefitsAccordionLink(enResults.eligible.eligible_benefits[0])
.invoke('removeAttr', 'href')
.click()
.then(() => {
// get all the events in our layer that matches the event value
const ev = [
...window.dataLayer.filter(
x => x?.event === dataLayerValueBenefitLink.event
),
]
removeID(ev[0])

pageObjects
.benefitsAccordionLink(enResults.eligible.eligible_benefits[0])
.invoke('removeAttr', 'href')
.click()
.then(() => {
// get all the events in our layer that matches the event value
const ev = [
...window.dataLayer.filter(
x => x?.event === dataLayerValueBenefitLink.event
),
]
removeID(ev[0])

expect(ev[0]).to.deep.equal(dataLayerValueBenefitLink)
})
expect(ev[0]).to.deep.equal(dataLayerValueBenefitLink)
})
})
})
})
})
Expand Down Expand Up @@ -995,8 +996,6 @@ describe('Calls to Google Analytics Object', function () {
dataLayerValueAccordionOpen.event
),
]
console.log(ev)
// delete ev[0]['gtm.uniqueEventId']
removeID(ev[0])

expect(ev[0]).to.deep.equal(
Expand Down Expand Up @@ -1036,8 +1035,6 @@ describe('Calls to Google Analytics Object', function () {
return item
})

console.log(cleanBfDataLayer)

expect(cleanBfDataLayer).to.deep.equal(
dataLayerValues
)
Expand Down

0 comments on commit 54a9919

Please sign in to comment.