Skip to content

Commit 03664aa

Browse files
jethronmatus-tomlein
authored andcommitted
Fix GA cookies unit tests broken by snowplow#1349 (snowplow#1353)
1 parent 8ccdea1 commit 03664aa

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

plugins/browser-plugin-ga-cookies/test/__snapshots__/ga-cookies.test.ts.snap

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,15 @@ Array [
157157
]
158158
`;
159159

160-
exports[`GA Cookies plugin Returns values for Universal Analytics cookies by default 1`] = `
160+
exports[`GA Cookies plugin Returns values for GA4 cookies by default 1`] = `
161161
Array [
162162
Object {
163163
"data": Object {
164-
"__utma": "567",
165164
"_ga": "1234",
165+
"cookie_prefix": undefined,
166+
"session_cookies": undefined,
166167
},
167-
"schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
168+
"schema": "iglu:com.google.ga4/cookies/jsonschema/1-0-0",
168169
},
169170
]
170171
`;

plugins/browser-plugin-ga-cookies/test/ga-cookies.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('GA Cookies plugin', () => {
2121
jest.clearAllMocks();
2222
});
2323

24-
it('Returns values for Universal Analytics cookies by default', (done) => {
24+
it('Returns values for GA4 cookies by default', (done) => {
2525
const containerId = '1234';
2626
document.cookie = `_ga=1234; __utma=567; _ga_${containerId}=567;`;
2727
const core = trackerCore({
@@ -42,7 +42,7 @@ describe('GA Cookies plugin', () => {
4242
const measurementId = `G-${containerId}`;
4343
document.cookie = ``;
4444
const core = trackerCore({
45-
corePlugins: [GaCookiesPlugin({ ga4: true, ga4MeasurementId: measurementId })],
45+
corePlugins: [GaCookiesPlugin({ ua: true, ga4MeasurementId: measurementId })],
4646
callback: (payloadBuilder) => {
4747
const { data } = payloadBuilder.getJson()[1].json;
4848
expect(data).toMatchSnapshot();
@@ -58,7 +58,7 @@ describe('GA Cookies plugin', () => {
5858
const measurementId = `G-${containerId}`;
5959
document.cookie = `_ga=1234; __utma=567; _ga_${containerId}=567;`;
6060
const core = trackerCore({
61-
corePlugins: [GaCookiesPlugin({ ga4: true, ga4MeasurementId: measurementId })],
61+
corePlugins: [GaCookiesPlugin({ ua: true, ga4MeasurementId: measurementId })],
6262
callback: (payloadBuilder) => {
6363
const { data } = payloadBuilder.getJson()[1].json;
6464
expect(data).toMatchSnapshot();

0 commit comments

Comments
 (0)