Skip to content

Commit 4ba24ee

Browse files
committed
Compare against full Gtag script in tests
1 parent 1357a22 commit 4ba24ee

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/analytics/src/helpers.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ describe('Gtag wrapping functions', () => {
6767
insertScriptTag(customDataLayerName, fakeMeasurementId);
6868
const scriptTag = findGtagScriptOnPage(customDataLayerName);
6969
expect(scriptTag).to.not.be.null;
70-
expect(scriptTag!.src).to.contain(`l=customDataLayerName`);
71-
expect(scriptTag!.src).to.contain(`id=${fakeMeasurementId}`);
70+
expect(scriptTag!.src).to.equal(`https://www.googletagmanager.com/gtag/js?l=${customDataLayerName}&id=${fakeMeasurementId}`);
7271
});
7372

7473
// The test above essentially already touches this functionality but it is still valuable

0 commit comments

Comments
 (0)