Skip to content

Commit

Permalink
Update test with initialiseGtag
Browse files Browse the repository at this point in the history
  • Loading branch information
hjvoid committed Jun 13, 2024
1 parent 9887324 commit 3e03c6c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/javascripts/application.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("Application JS", () => {
document.cookie = "govuk_pay_cookie_policy=;expires=Thu, 01 Jan 1970 00:00:00 UTC;domain=.example.org";

window.GovUkPay.cookies.showBannerIfConsentNotSet = jest.fn()
window.initialiseGoogleAnalytics = jest.fn()
window.initialiseGtag = jest.fn()

// Override Document ready function in the test
window.addEventListener = (event, callback) => {
Expand All @@ -33,7 +33,7 @@ describe("Application JS", () => {
require("./application")

expect(
window.initialiseGoogleAnalytics.mock.calls.length
window.initialiseGtag.mock.calls.length
).toBe(0);
});

Expand All @@ -43,7 +43,7 @@ describe("Application JS", () => {
require("./application")

expect(
window.initialiseGoogleAnalytics.mock.calls.length
window.initialiseGtag.mock.calls.length
).toBe(0);
});

Expand All @@ -54,7 +54,7 @@ describe("Application JS", () => {
require("./application")

expect(
window.initialiseGoogleAnalytics.mock.calls.length
window.initialiseGtag.mock.calls.length
).toBe(1);
});
});

0 comments on commit 3e03c6c

Please sign in to comment.