Skip to content

Commit 05ca0d1

Browse files
committed
Add back 'set' test
1 parent 572a151 commit 05ca0d1

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

packages/analytics/src/helpers.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,19 @@ describe('Gtag wrapping functions', () => {
214214
expect((window['dataLayer'] as DataLayer).length).to.equal(1);
215215
});
216216

217+
it('new window.gtag function does not wait when sending "set" calls', async () => {
218+
wrapOrCreateGtag(
219+
{ [fakeAppId]: Promise.resolve(fakeMeasurementId) },
220+
fakeDynamicConfigPromises,
221+
{},
222+
'dataLayer',
223+
'gtag'
224+
);
225+
window['dataLayer'] = [];
226+
(window['gtag'] as Gtag)(GtagCommand.SET, { 'language': 'en' });
227+
expect((window['dataLayer'] as DataLayer).length).to.equal(1);
228+
});
229+
217230
it('new window.gtag function does not wait when sending "consent" calls', async () => {
218231
const consentParameters: ConsentSettings = {
219232
'analytics_storage': 'granted',

packages/analytics/src/public-types.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,20 @@ export interface EventParams {
297297
* @public
298298
*/
299299
export interface ConsentSettings {
300-
// Enables storage, such as cookies, related to advertising
300+
/** Enables storage, such as cookies, related to advertising */
301301
ad_storage?: ConsentStatusString;
302-
// Enables storage, such as cookies, related to analytics (for example, visit duration)
302+
/** Enables storage, such as cookies, related to analytics (for example, visit duration) */
303303
analytics_storage?: ConsentStatusString;
304-
// Enables storage that supports the functionality of the website or app such as language settings
304+
/**
305+
* Enables storage that supports the functionality of the website or app such as language settings
306+
*/
305307
functionality_storage?: ConsentStatusString;
306-
// Enables storage related to personalization such as video recommendations
308+
/** Enables storage related to personalization such as video recommendations */
307309
personalization_storage?: ConsentStatusString;
308-
// Enables storage related to security such as authentication functionality, fraud prevention,
309-
// and other user protection
310+
/**
311+
* Enables storage related to security such as authentication functionality, fraud prevention,
312+
* and other user protection.
313+
*/
310314
security_storage?: ConsentStatusString;
311315
[key: string]: unknown;
312316
}

0 commit comments

Comments
 (0)