Skip to content

Commit

Permalink
Compare against full Gtag script in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dlarocque committed Jul 11, 2024
1 parent 6c7fd0e commit 1483f41
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/analytics/src/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ describe('Gtag wrapping functions', () => {
insertScriptTag(customDataLayerName, fakeMeasurementId);
const scriptTag = findGtagScriptOnPage(customDataLayerName);
expect(scriptTag).to.not.be.null;
expect(scriptTag!.src).to.contain(`l=customDataLayerName`);
expect(scriptTag!.src).to.contain(`id=${fakeMeasurementId}`);
expect(scriptTag!.src).to.equal(`https://www.googletagmanager.com/gtag/js?l=${customDataLayerName}&id=${fakeMeasurementId}`);
});

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

0 comments on commit 1483f41

Please sign in to comment.