Skip to content

Commit c89dda3

Browse files
async handling
1 parent 93ba9c7 commit c89dda3

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

packages/destinations/web/google-ads/src/index.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('destination Google Ads', () => {
3434

3535
afterEach(() => {});
3636

37-
test('init', () => {
37+
test('init', async () => {
3838
(w.dataLayer as unknown) = undefined;
3939
(w.gtag as unknown) = undefined;
4040

@@ -46,7 +46,7 @@ describe('destination Google Ads', () => {
4646
expect(w.dataLayer).not.toBeDefined();
4747
expect(w.gtag).not.toBeDefined();
4848

49-
elb(event);
49+
await elb(event);
5050
expect(w.dataLayer).toBeDefined();
5151
expect(w.gtag).toBeDefined();
5252
});
@@ -64,15 +64,15 @@ describe('destination Google Ads', () => {
6464
expect(fn).toHaveBeenCalledTimes(3);
6565
});
6666

67-
test('Init calls', () => {
67+
test('Init calls', async () => {
6868
elb('walker destination', destination);
6969

70-
elb(event);
70+
await elb(event);
7171

7272
expect(mockFn).toHaveBeenNthCalledWith(1, 'config', conversionId);
7373
});
7474

75-
test('init with load script', () => {
75+
test('init with load script', async () => {
7676
destination.config.loadScript = true;
7777
elb('walker destination', destination);
7878

@@ -81,7 +81,7 @@ describe('destination Google Ads', () => {
8181
let elem = document.querySelector(scriptSelector);
8282
expect(elem).not.toBeTruthy();
8383

84-
elb(event);
84+
await elb(event);
8585

8686
elem = document.querySelector(scriptSelector);
8787
expect(elem).toBeTruthy();

packages/destinations/web/piwikpro/src/index.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,23 @@ describe('Destination PiwikPro', () => {
8585
expect(mockFn).toHaveBeenCalledWith(...events.ecommerceAddToCart());
8686
});
8787

88-
test('event ecommerceProductDetailView', () => {
88+
test('event ecommerceProductDetailView', async () => {
8989
const event = getEvent('product view');
9090
elb('walker destination', destination, {
9191
custom,
9292
mapping: mapping.config,
9393
});
94-
elb(event);
94+
await elb(event);
9595
expect(mockFn).toHaveBeenCalledWith(...events.ecommerceProductDetailView());
9696
});
9797

98-
test('event ecommerceCartUpdate', () => {
98+
test('event ecommerceCartUpdate', async () => {
9999
const event = getEvent('cart view');
100100
elb('walker destination', destination, {
101101
custom,
102102
mapping: mapping.config,
103103
});
104-
elb(event);
104+
await elb(event);
105105
expect(mockFn).toHaveBeenCalledWith(...events.ecommerceCartUpdate());
106106
});
107107
});

packages/destinations/web/piwikpro/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ export const destinationPiwikPro: Destination = {
3636
if (custom.linkTracking !== false) func(['enableLinkTracking']);
3737
},
3838

39-
push(event, config, mapping = {}, options = {}) {
39+
async push(event, config, mapping = {}, options = {}) {
4040
const { fn } = config;
4141
const { data } = options;
4242
const func = fn || window._paq!.push;
4343

4444
// Send pageviews if not disabled
4545
if (event.event === 'page view' && !mapping.custom) {
46-
func(['trackPageView', getMappingValue(event, 'data.title')]);
46+
func(['trackPageView', await getMappingValue(event, 'data.title')]);
4747
return;
4848
}
4949

0 commit comments

Comments
 (0)