@walkeros/collector 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/auto-run.test.d.ts +2 -0
- package/dist/__tests__/auto-run.test.d.ts.map +1 -0
- package/dist/__tests__/auto-run.test.js +105 -0
- package/dist/__tests__/auto-run.test.js.map +1 -0
- package/dist/__tests__/consent.test.d.ts +2 -0
- package/dist/__tests__/consent.test.d.ts.map +1 -0
- package/dist/__tests__/consent.test.js +21 -0
- package/dist/__tests__/consent.test.js.map +1 -0
- package/dist/__tests__/create-flow.test.d.ts +2 -0
- package/dist/__tests__/create-flow.test.d.ts.map +1 -0
- package/dist/__tests__/create-flow.test.js +69 -0
- package/dist/__tests__/create-flow.test.js.map +1 -0
- package/dist/__tests__/destination.test.d.ts +2 -0
- package/dist/__tests__/destination.test.d.ts.map +1 -0
- package/dist/__tests__/destination.test.js +242 -0
- package/dist/__tests__/destination.test.js.map +1 -0
- package/dist/__tests__/handle.test.d.ts +2 -0
- package/dist/__tests__/handle.test.d.ts.map +1 -0
- package/dist/__tests__/handle.test.js +78 -0
- package/dist/__tests__/handle.test.js.map +1 -0
- package/dist/__tests__/mapping.test.d.ts +2 -0
- package/dist/__tests__/mapping.test.d.ts.map +1 -0
- package/dist/__tests__/mapping.test.js +310 -0
- package/dist/__tests__/mapping.test.js.map +1 -0
- package/dist/__tests__/source.test.d.ts +2 -0
- package/dist/__tests__/source.test.d.ts.map +1 -0
- package/dist/__tests__/source.test.js +306 -0
- package/dist/__tests__/source.test.js.map +1 -0
- package/dist/__tests__/start-flow.test.d.ts +2 -0
- package/dist/__tests__/start-flow.test.d.ts.map +1 -0
- package/dist/__tests__/start-flow.test.js +167 -0
- package/dist/__tests__/start-flow.test.js.map +1 -0
- package/dist/__tests__/walker-entity.test.d.ts +2 -0
- package/dist/__tests__/walker-entity.test.d.ts.map +1 -0
- package/dist/__tests__/walker-entity.test.js +52 -0
- package/dist/__tests__/walker-entity.test.js.map +1 -0
- package/dist/collector.d.ts +3 -0
- package/dist/collector.d.ts.map +1 -0
- package/dist/collector.js +59 -0
- package/dist/collector.js.map +1 -0
- package/dist/command.d.ts +12 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +20 -0
- package/dist/command.js.map +1 -0
- package/dist/consent.d.ts +10 -0
- package/dist/consent.d.ts.map +1 -0
- package/dist/consent.js +30 -0
- package/dist/consent.js.map +1 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +35 -0
- package/dist/constants.js.map +1 -0
- package/dist/destination.d.ts +56 -0
- package/dist/destination.d.ts.map +1 -0
- package/dist/destination.js +289 -0
- package/dist/destination.js.map +1 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/elb.d.ts +11 -0
- package/dist/elb.d.ts.map +1 -0
- package/dist/elb.js +60 -0
- package/dist/elb.js.map +1 -0
- package/dist/flow.d.ts +4 -0
- package/dist/flow.d.ts.map +1 -0
- package/dist/flow.js +44 -0
- package/dist/flow.js.map +1 -0
- package/dist/handle.d.ts +29 -0
- package/dist/handle.d.ts.map +1 -0
- package/dist/handle.js +161 -0
- package/dist/handle.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/on.d.ts +19 -0
- package/dist/on.d.ts.map +1 -0
- package/dist/on.js +116 -0
- package/dist/on.js.map +1 -0
- package/dist/push.d.ts +11 -0
- package/dist/push.d.ts.map +1 -0
- package/dist/push.js +43 -0
- package/dist/push.js.map +1 -0
- package/dist/schemas.d.ts +6 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +37 -0
- package/dist/schemas.js.map +1 -0
- package/dist/source.d.ts +10 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +40 -0
- package/dist/source.js.map +1 -0
- package/dist/types/collector.d.ts +19 -0
- package/dist/types/collector.d.ts.map +1 -0
- package/dist/types/collector.js +2 -0
- package/dist/types/collector.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-run.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/auto-run.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { startFlow } from '..';
|
|
2
|
+
describe('Auto-run functionality', () => {
|
|
3
|
+
describe('startFlow auto-run behavior', () => {
|
|
4
|
+
test('auto-runs by default (collector.allowed should be true)', async () => {
|
|
5
|
+
const { collector } = await startFlow();
|
|
6
|
+
// Default behavior should auto-run and set allowed to true
|
|
7
|
+
expect(collector.allowed).toBe(true);
|
|
8
|
+
expect(collector.config.run).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
test('auto-runs when explicitly set to true (collector.allowed should be true)', async () => {
|
|
11
|
+
const { collector } = await startFlow({ run: true });
|
|
12
|
+
// Explicitly setting run: true should auto-run and set allowed to true
|
|
13
|
+
expect(collector.allowed).toBe(true);
|
|
14
|
+
expect(collector.config.run).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
test('does not auto-run when set to false (collector.allowed should be false)', async () => {
|
|
17
|
+
const { collector } = await startFlow({ run: false });
|
|
18
|
+
// Setting run: false should NOT auto-run and allowed should stay false
|
|
19
|
+
expect(collector.allowed).toBe(false);
|
|
20
|
+
expect(collector.config.run).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
test('manual run after initialization with run: false should set allowed to true', async () => {
|
|
23
|
+
const { collector, elb } = await startFlow({ run: false });
|
|
24
|
+
// Initially should not be allowed
|
|
25
|
+
expect(collector.allowed).toBe(false);
|
|
26
|
+
// Manual run should set allowed to true
|
|
27
|
+
await elb('walker run');
|
|
28
|
+
expect(collector.allowed).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
test('config state is preserved correctly for different run values', async () => {
|
|
31
|
+
// Test with run: true
|
|
32
|
+
const collectorTrue = await startFlow({ run: true, verbose: true });
|
|
33
|
+
expect(collectorTrue.collector.config.run).toBe(true);
|
|
34
|
+
expect(collectorTrue.collector.config.verbose).toBe(true);
|
|
35
|
+
expect(collectorTrue.collector.allowed).toBe(true);
|
|
36
|
+
// Test with run: false
|
|
37
|
+
const collectorFalse = await startFlow({
|
|
38
|
+
run: false,
|
|
39
|
+
verbose: true,
|
|
40
|
+
});
|
|
41
|
+
expect(collectorFalse.collector.config.run).toBe(false);
|
|
42
|
+
expect(collectorFalse.collector.config.verbose).toBe(true);
|
|
43
|
+
expect(collectorFalse.collector.allowed).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe('auto-run with additional configuration', () => {
|
|
47
|
+
test('applies consent during auto-run', async () => {
|
|
48
|
+
const testConsent = { functional: true, marketing: false };
|
|
49
|
+
const { collector } = await startFlow({
|
|
50
|
+
run: true,
|
|
51
|
+
consent: testConsent,
|
|
52
|
+
});
|
|
53
|
+
expect(collector.allowed).toBe(true);
|
|
54
|
+
expect(collector.consent).toEqual(testConsent);
|
|
55
|
+
});
|
|
56
|
+
test('applies user data during auto-run', async () => {
|
|
57
|
+
const testUser = { id: 'test-user-123', custom: { type: 'premium' } };
|
|
58
|
+
const { collector } = await startFlow({
|
|
59
|
+
run: true,
|
|
60
|
+
user: testUser,
|
|
61
|
+
});
|
|
62
|
+
expect(collector.allowed).toBe(true);
|
|
63
|
+
expect(collector.user).toEqual(testUser);
|
|
64
|
+
});
|
|
65
|
+
test('applies globals during auto-run', async () => {
|
|
66
|
+
const testGlobals = { page_title: 'Test Page', environment: 'test' };
|
|
67
|
+
const { collector } = await startFlow({
|
|
68
|
+
run: true,
|
|
69
|
+
globals: testGlobals,
|
|
70
|
+
});
|
|
71
|
+
expect(collector.allowed).toBe(true);
|
|
72
|
+
expect(collector.globals).toEqual(expect.objectContaining(testGlobals));
|
|
73
|
+
});
|
|
74
|
+
test('applies custom data during auto-run', async () => {
|
|
75
|
+
const testCustom = { tracking_id: 'GTM-12345', debug: true };
|
|
76
|
+
const { collector } = await startFlow({
|
|
77
|
+
run: true,
|
|
78
|
+
custom: testCustom,
|
|
79
|
+
});
|
|
80
|
+
expect(collector.allowed).toBe(true);
|
|
81
|
+
expect(collector.custom).toEqual(testCustom);
|
|
82
|
+
});
|
|
83
|
+
test('does not apply additional config when run: false', async () => {
|
|
84
|
+
const testConsent = { functional: true, marketing: false };
|
|
85
|
+
const testUser = { id: 'test-user-123' };
|
|
86
|
+
const testGlobals = { page_title: 'Test Page' };
|
|
87
|
+
const testCustom = { tracking_id: 'GTM-12345' };
|
|
88
|
+
const { collector } = await startFlow({
|
|
89
|
+
run: false,
|
|
90
|
+
consent: testConsent,
|
|
91
|
+
user: testUser,
|
|
92
|
+
globals: testGlobals,
|
|
93
|
+
custom: testCustom,
|
|
94
|
+
});
|
|
95
|
+
// Should not be allowed since we didn't run
|
|
96
|
+
expect(collector.allowed).toBe(false);
|
|
97
|
+
// But the config should still be stored for potential later use
|
|
98
|
+
expect(collector.consent).toEqual(testConsent);
|
|
99
|
+
expect(collector.user).toEqual(testUser);
|
|
100
|
+
expect(collector.globals).toEqual(expect.objectContaining(testGlobals));
|
|
101
|
+
expect(collector.custom).toEqual(testCustom);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=auto-run.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-run.test.js","sourceRoot":"","sources":["../../src/__tests__/auto-run.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QAC3C,IAAI,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;YACzE,MAAM,EAAE,SAAS,EAAE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AQ,CAAC,CAAC;YACzC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC;YACxE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/consent.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getGrantedConsent } from '@walkeros/core';
|
|
2
|
+
describe('consent', () => {
|
|
3
|
+
test('nothing required', () => {
|
|
4
|
+
expect(getGrantedConsent(undefined, { foo: true })).toStrictEqual({
|
|
5
|
+
foo: true,
|
|
6
|
+
});
|
|
7
|
+
});
|
|
8
|
+
test('denied', () => {
|
|
9
|
+
expect(getGrantedConsent({ marketing: true }, { functional: true, marketing: false })).toBeFalsy();
|
|
10
|
+
});
|
|
11
|
+
test('granted by destination', () => {
|
|
12
|
+
expect(getGrantedConsent({ functional: true }, { functional: true })).toStrictEqual({ functional: true });
|
|
13
|
+
});
|
|
14
|
+
test('granted individually', () => {
|
|
15
|
+
expect(getGrantedConsent({ marketing: true }, { marketing: false }, { marketing: true })).toStrictEqual({ marketing: true });
|
|
16
|
+
});
|
|
17
|
+
test('granted states', () => {
|
|
18
|
+
expect(getGrantedConsent({ foo: true }, { foo: true }, { bar: true })).toStrictEqual({ foo: true, bar: true });
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=consent.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent.test.js","sourceRoot":"","sources":["../../src/__tests__/consent.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,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G,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-flow.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/create-flow.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { startFlow } from '../flow';
|
|
2
|
+
describe('Source Create Flow Integration', () => {
|
|
3
|
+
it('should initialize complete setup from flow config', async () => {
|
|
4
|
+
const mockPushCalls = [];
|
|
5
|
+
const mockSource = async (config, env) => {
|
|
6
|
+
expect(config).toEqual({
|
|
7
|
+
settings: {
|
|
8
|
+
test: 'value',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
expect(env).toMatchObject({
|
|
12
|
+
push: expect.any(Function),
|
|
13
|
+
command: expect.any(Function),
|
|
14
|
+
sources: expect.any(Object),
|
|
15
|
+
elb: expect.any(Function),
|
|
16
|
+
foo: 'bar',
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
type: 'mock',
|
|
20
|
+
config: {
|
|
21
|
+
settings: config.settings || {},
|
|
22
|
+
},
|
|
23
|
+
push: env.push, // Required push method
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const { collector, elb } = await startFlow({
|
|
27
|
+
sources: {
|
|
28
|
+
mockSource: {
|
|
29
|
+
code: mockSource,
|
|
30
|
+
config: {
|
|
31
|
+
settings: {
|
|
32
|
+
test: 'value',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
env: {
|
|
36
|
+
foo: 'bar',
|
|
37
|
+
// elb will be injected by collector
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
destinations: {
|
|
42
|
+
test: {
|
|
43
|
+
code: {
|
|
44
|
+
type: 'test',
|
|
45
|
+
config: {},
|
|
46
|
+
push: (event) => {
|
|
47
|
+
mockPushCalls.push(event);
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
expect(collector.sources.mockSource).toEqual({
|
|
54
|
+
type: 'mock',
|
|
55
|
+
config: {
|
|
56
|
+
settings: { test: 'value' },
|
|
57
|
+
},
|
|
58
|
+
push: expect.any(Function),
|
|
59
|
+
});
|
|
60
|
+
expect(collector.sources.elb).toBeDefined();
|
|
61
|
+
await elb({ name: 'manual event', data: { test: 'data' } });
|
|
62
|
+
expect(mockPushCalls).toHaveLength(1);
|
|
63
|
+
expect(mockPushCalls[0]).toMatchObject({
|
|
64
|
+
name: 'manual event',
|
|
65
|
+
data: { test: 'data' },
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=create-flow.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-flow.test.js","sourceRoot":"","sources":["../../src/__tests__/create-flow.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,aAAa,GAAqB,EAAE,CAAC;QAE3C,MAAM,UAAU,GAAgB,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;YACpD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;gBACrB,QAAQ,EAAE;oBACR,IAAI,EAAE,OAAO;iBACd;aACF,CAAC,CAAC;YAEH,MAAM,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC;gBACxB,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAC1B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAC7B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;gBAC3B,GAA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AAC,CAAC;QAE5D,MAAM,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;YACrC,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACvB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destination.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/destination.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { clone, createEvent } from '@walkeros/core';
|
|
2
|
+
import { pushToDestinations, startFlow } from '..';
|
|
3
|
+
describe('Destination', () => {
|
|
4
|
+
let event;
|
|
5
|
+
let destination;
|
|
6
|
+
let config;
|
|
7
|
+
let mockInit;
|
|
8
|
+
let mockPush;
|
|
9
|
+
function createDestination(args) {
|
|
10
|
+
return {
|
|
11
|
+
init: mockInit,
|
|
12
|
+
push: mockPush,
|
|
13
|
+
config: {},
|
|
14
|
+
...args,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function createTestConfig(overrides = {}) {
|
|
18
|
+
return {
|
|
19
|
+
tagging: 1,
|
|
20
|
+
verbose: false,
|
|
21
|
+
globalsStatic: {},
|
|
22
|
+
sessionStatic: {},
|
|
23
|
+
...overrides,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createWalkerjs(args) {
|
|
27
|
+
const defaultConfig = createTestConfig();
|
|
28
|
+
return {
|
|
29
|
+
allowed: true,
|
|
30
|
+
destinations: { foo: destination },
|
|
31
|
+
globals: {},
|
|
32
|
+
hooks: {},
|
|
33
|
+
user: {},
|
|
34
|
+
consent: {},
|
|
35
|
+
queue: [],
|
|
36
|
+
...args,
|
|
37
|
+
config: args?.config ? createTestConfig(args.config) : defaultConfig,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
event = createEvent();
|
|
42
|
+
mockInit = jest.fn(); //.mockImplementation(console.log);
|
|
43
|
+
mockPush = jest.fn(); //.mockImplementation(console.log);
|
|
44
|
+
config = { init: false };
|
|
45
|
+
destination = {
|
|
46
|
+
init: mockInit,
|
|
47
|
+
push: mockPush,
|
|
48
|
+
config,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
test('allowed', async () => {
|
|
52
|
+
const collector = createWalkerjs({ allowed: false });
|
|
53
|
+
let result = await pushToDestinations(collector, event);
|
|
54
|
+
expect(result.ok).toBeFalsy();
|
|
55
|
+
collector.allowed = true;
|
|
56
|
+
result = await pushToDestinations(collector, event);
|
|
57
|
+
expect(result.ok).toBeTruthy();
|
|
58
|
+
});
|
|
59
|
+
test('preventing data manipulation', async () => {
|
|
60
|
+
const clonedEvent = clone(event);
|
|
61
|
+
const mockPushUpdate = jest.fn().mockImplementation((event) => {
|
|
62
|
+
event.data.foo = 'bar';
|
|
63
|
+
});
|
|
64
|
+
const destinationUpdate = {
|
|
65
|
+
init: mockInit,
|
|
66
|
+
push: mockPushUpdate,
|
|
67
|
+
config: {},
|
|
68
|
+
};
|
|
69
|
+
await pushToDestinations(createWalkerjs(), event, {
|
|
70
|
+
destinationUpdate,
|
|
71
|
+
destination,
|
|
72
|
+
});
|
|
73
|
+
expect(mockPushUpdate).toHaveBeenCalledTimes(1);
|
|
74
|
+
expect(mockPush).toHaveBeenCalledTimes(1);
|
|
75
|
+
expect(mockPush).toHaveBeenCalledWith(clonedEvent, expect.objectContaining({
|
|
76
|
+
config: { init: true },
|
|
77
|
+
}));
|
|
78
|
+
});
|
|
79
|
+
test('failing init', async () => {
|
|
80
|
+
// Simulate a failed init
|
|
81
|
+
mockInit.mockImplementation(() => false);
|
|
82
|
+
await pushToDestinations(createWalkerjs(), event);
|
|
83
|
+
expect(mockInit).toHaveBeenCalledTimes(1);
|
|
84
|
+
expect(mockPush).toHaveBeenCalledTimes(0);
|
|
85
|
+
expect(destination.config.init).toBeFalsy();
|
|
86
|
+
});
|
|
87
|
+
test('DLQ', async () => {
|
|
88
|
+
const event = createEvent();
|
|
89
|
+
// Simulate a failing push
|
|
90
|
+
mockPush.mockImplementation(() => {
|
|
91
|
+
throw new Error('kaputt');
|
|
92
|
+
});
|
|
93
|
+
const destination = createDestination();
|
|
94
|
+
const result = await pushToDestinations(createWalkerjs(), event, {
|
|
95
|
+
destination,
|
|
96
|
+
});
|
|
97
|
+
expect(result.failed).toHaveLength(1);
|
|
98
|
+
expect(result.ok).toBeFalsy();
|
|
99
|
+
expect(mockPush).toHaveBeenCalledTimes(1);
|
|
100
|
+
expect(destination.dlq).toContainEqual([event, new Error('kaputt')]);
|
|
101
|
+
});
|
|
102
|
+
test('skip on denied consent', async () => { });
|
|
103
|
+
describe('destination on method', () => {
|
|
104
|
+
let mockOnMethod;
|
|
105
|
+
beforeEach(() => {
|
|
106
|
+
mockOnMethod = jest.fn();
|
|
107
|
+
});
|
|
108
|
+
it('should call destination on method when consent event is triggered', async () => {
|
|
109
|
+
const destinationWithOn = createDestination({
|
|
110
|
+
on: mockOnMethod,
|
|
111
|
+
config: { init: true },
|
|
112
|
+
});
|
|
113
|
+
const { collector, elb } = await startFlow({
|
|
114
|
+
destinations: { testDestination: { code: destinationWithOn } },
|
|
115
|
+
});
|
|
116
|
+
// Trigger consent event
|
|
117
|
+
await elb('walker consent', { marketing: true });
|
|
118
|
+
// Verify the destination's on method was called with consent context
|
|
119
|
+
expect(mockOnMethod).toHaveBeenCalledWith('consent', { marketing: true });
|
|
120
|
+
});
|
|
121
|
+
it('should call destination on method when session event is triggered', async () => {
|
|
122
|
+
const destinationWithOn = createDestination({
|
|
123
|
+
on: mockOnMethod,
|
|
124
|
+
config: { init: true },
|
|
125
|
+
});
|
|
126
|
+
const { collector, elb } = await startFlow({
|
|
127
|
+
destinations: { testDestination: { code: destinationWithOn } },
|
|
128
|
+
});
|
|
129
|
+
// Set session data and trigger session event
|
|
130
|
+
collector.session = {
|
|
131
|
+
id: 'test-session',
|
|
132
|
+
isStart: true,
|
|
133
|
+
storage: false,
|
|
134
|
+
device: 'test',
|
|
135
|
+
};
|
|
136
|
+
await elb('walker session');
|
|
137
|
+
// Verify the destination's on method was called with session context
|
|
138
|
+
expect(mockOnMethod).toHaveBeenCalledWith('session', collector.session);
|
|
139
|
+
});
|
|
140
|
+
it('should call destination on method when ready event is triggered', async () => {
|
|
141
|
+
const destinationWithOn = createDestination({
|
|
142
|
+
on: mockOnMethod,
|
|
143
|
+
config: { init: true },
|
|
144
|
+
});
|
|
145
|
+
const { collector, elb } = await startFlow({
|
|
146
|
+
destinations: { testDestination: { code: destinationWithOn } },
|
|
147
|
+
});
|
|
148
|
+
// Trigger ready event
|
|
149
|
+
await elb('walker ready');
|
|
150
|
+
// Verify the destination's on method was called
|
|
151
|
+
expect(mockOnMethod).toHaveBeenCalledWith('ready', undefined);
|
|
152
|
+
});
|
|
153
|
+
it('should call destination on method when run event is triggered', async () => {
|
|
154
|
+
const destinationWithOn = createDestination({
|
|
155
|
+
on: mockOnMethod,
|
|
156
|
+
config: { init: true },
|
|
157
|
+
});
|
|
158
|
+
const { collector, elb } = await startFlow({
|
|
159
|
+
destinations: { testDestination: { code: destinationWithOn } },
|
|
160
|
+
});
|
|
161
|
+
// Trigger run event
|
|
162
|
+
await elb('walker run');
|
|
163
|
+
// Verify the destination's on method was called
|
|
164
|
+
expect(mockOnMethod).toHaveBeenCalledWith('run', undefined);
|
|
165
|
+
});
|
|
166
|
+
it('should not fail if destination does not have on method', async () => {
|
|
167
|
+
const destinationWithoutOn = createDestination({
|
|
168
|
+
config: { init: true },
|
|
169
|
+
});
|
|
170
|
+
const { collector, elb } = await startFlow({
|
|
171
|
+
destinations: { testDestination: { code: destinationWithoutOn } },
|
|
172
|
+
});
|
|
173
|
+
// Should not throw when destination has no on method
|
|
174
|
+
expect(async () => {
|
|
175
|
+
await elb('walker consent', { marketing: true });
|
|
176
|
+
await elb('walker session');
|
|
177
|
+
await elb('walker ready');
|
|
178
|
+
await elb('walker run');
|
|
179
|
+
}).not.toThrow();
|
|
180
|
+
});
|
|
181
|
+
it('should handle async on method', async () => {
|
|
182
|
+
const asyncOnMethod = jest.fn().mockResolvedValue(undefined);
|
|
183
|
+
const destinationWithAsyncOn = createDestination({
|
|
184
|
+
on: asyncOnMethod,
|
|
185
|
+
config: { init: true },
|
|
186
|
+
});
|
|
187
|
+
const { collector, elb } = await startFlow({
|
|
188
|
+
destinations: { testDestination: { code: destinationWithAsyncOn } },
|
|
189
|
+
});
|
|
190
|
+
// Trigger consent event
|
|
191
|
+
await elb('walker consent', { marketing: true });
|
|
192
|
+
// Verify the async destination's on method was called
|
|
193
|
+
expect(asyncOnMethod).toHaveBeenCalledWith('consent', {
|
|
194
|
+
marketing: true,
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
it('should call on method for multiple destinations', async () => {
|
|
198
|
+
const mockOn1 = jest.fn();
|
|
199
|
+
const mockOn2 = jest.fn();
|
|
200
|
+
const destination1 = createDestination({
|
|
201
|
+
on: mockOn1,
|
|
202
|
+
config: { init: true },
|
|
203
|
+
});
|
|
204
|
+
const destination2 = createDestination({
|
|
205
|
+
on: mockOn2,
|
|
206
|
+
config: { init: true },
|
|
207
|
+
});
|
|
208
|
+
const { collector, elb } = await startFlow({
|
|
209
|
+
destinations: {
|
|
210
|
+
dest1: { code: destination1 },
|
|
211
|
+
dest2: { code: destination2 },
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
// Trigger consent event
|
|
215
|
+
await elb('walker consent', { marketing: true });
|
|
216
|
+
// Both destinations should receive the event
|
|
217
|
+
expect(mockOn1).toHaveBeenCalledWith('consent', { marketing: true });
|
|
218
|
+
expect(mockOn2).toHaveBeenCalledWith('consent', { marketing: true });
|
|
219
|
+
});
|
|
220
|
+
it('should handle on method errors gracefully', async () => {
|
|
221
|
+
const errorOnMethod = jest.fn().mockImplementation(() => {
|
|
222
|
+
throw new Error('On method error');
|
|
223
|
+
});
|
|
224
|
+
const destinationWithErrorOn = createDestination({
|
|
225
|
+
on: errorOnMethod,
|
|
226
|
+
config: { init: true },
|
|
227
|
+
});
|
|
228
|
+
const { collector, elb } = await startFlow({
|
|
229
|
+
destinations: { testDestination: { code: destinationWithErrorOn } },
|
|
230
|
+
});
|
|
231
|
+
// Should not throw even if on method throws an error
|
|
232
|
+
expect(async () => {
|
|
233
|
+
await elb('walker consent', { marketing: true });
|
|
234
|
+
}).not.toThrow();
|
|
235
|
+
// On method should still have been called
|
|
236
|
+
expect(errorOnMethod).toHaveBeenCalledWith('consent', {
|
|
237
|
+
marketing: true,
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
//# sourceMappingURL=destination.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destination.test.js","sourceRoot":"","sources":["../../src/__tests__/destination.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEnD,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,KAAqB,CAAC;IAC1B,IAAI,WAAiC,CAAC;IACtC,IAAI,MAA0B,CAAC;IAC/B,IAAI,QAAmB,CAAC;IACxB,IAAI,QAAmB,CAAC;IAExB,SAAS,iBAAiB,CACxB,IAAoC;QAEpC,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,EAAE;YACV,GAAG,IAAI;SACgB,CAAC;IAC5B,CAAC;IAED,SAAS,gBAAgB,CACvB,YAAuC,EAAE;QAEzC,OAAO;YACL,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,EAAE;YACjB,aAAa,EAA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AAe,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE;aACpE,CAAC,CAAC;YAEH,qDAAqD;YACrD,MAAM,CAAC,KAAK,IAAI,EAAE;gBAChB,MAAM,GAAG,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YAEjB,0CAA0C;YAC1C,MAAM,CAAC,aAAa,CAAC,CAAC,oBAAoB,CAAC,SAAS,EAAE;gBACpD,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/handle.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { startFlow } from '..';
|
|
2
|
+
import { commonHandleCommand } from '../handle';
|
|
3
|
+
describe('Handle Commands', () => {
|
|
4
|
+
let mockDestinationPush;
|
|
5
|
+
let mockDestinationInit;
|
|
6
|
+
let mockDestination;
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
jest.clearAllMocks();
|
|
9
|
+
mockDestinationPush = jest.fn();
|
|
10
|
+
mockDestinationInit = jest.fn().mockResolvedValue({ settings: {} });
|
|
11
|
+
mockDestination = {
|
|
12
|
+
type: 'test',
|
|
13
|
+
config: {},
|
|
14
|
+
init: mockDestinationInit,
|
|
15
|
+
push: mockDestinationPush,
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
describe('walker destination command', () => {
|
|
19
|
+
test('adds destination without config', async () => {
|
|
20
|
+
const { elb, collector } = await startFlow({});
|
|
21
|
+
// Initially no destinations
|
|
22
|
+
expect(Object.keys(collector.destinations)).toHaveLength(0);
|
|
23
|
+
// Add destination without config
|
|
24
|
+
await elb('walker destination', mockDestination);
|
|
25
|
+
// Destination should be added with some default config
|
|
26
|
+
expect(Object.keys(collector.destinations)).toHaveLength(1);
|
|
27
|
+
const destinationId = Object.keys(collector.destinations)[0];
|
|
28
|
+
expect(collector.destinations[destinationId]).toBeDefined();
|
|
29
|
+
expect(collector.destinations[destinationId].config).toBeDefined();
|
|
30
|
+
});
|
|
31
|
+
test('adds destination with config including custom id', async () => {
|
|
32
|
+
const { elb, collector } = await startFlow({});
|
|
33
|
+
const customConfig = {
|
|
34
|
+
id: 'my-custom-id',
|
|
35
|
+
init: true,
|
|
36
|
+
loadScript: false,
|
|
37
|
+
mapping: {
|
|
38
|
+
entity: {
|
|
39
|
+
action: {
|
|
40
|
+
name: 'CustomEvent',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
// Add destination with config
|
|
46
|
+
await elb('walker destination', mockDestination, customConfig);
|
|
47
|
+
// Destination should be added with custom id and config
|
|
48
|
+
expect(Object.keys(collector.destinations)).toEqual(['my-custom-id']);
|
|
49
|
+
expect(collector.destinations['my-custom-id']).toBeDefined();
|
|
50
|
+
expect(collector.destinations['my-custom-id'].config).toEqual(customConfig);
|
|
51
|
+
});
|
|
52
|
+
test('adds destination with config and stores it properly', async () => {
|
|
53
|
+
const { elb, collector } = await startFlow({});
|
|
54
|
+
const customConfig = {
|
|
55
|
+
id: 'test-destination',
|
|
56
|
+
settings: { apiKey: 'test-key' },
|
|
57
|
+
};
|
|
58
|
+
// Add destination with config
|
|
59
|
+
await elb('walker destination', mockDestination, customConfig);
|
|
60
|
+
// Destination should be added with custom config
|
|
61
|
+
expect(collector.destinations['test-destination']).toBeDefined();
|
|
62
|
+
expect(collector.destinations['test-destination'].config).toEqual(customConfig);
|
|
63
|
+
});
|
|
64
|
+
test('handles destination config through commonHandleCommand', async () => {
|
|
65
|
+
const { collector } = await startFlow({});
|
|
66
|
+
const customConfig = {
|
|
67
|
+
id: 'cmd-test',
|
|
68
|
+
settings: { foo: 'bar' },
|
|
69
|
+
};
|
|
70
|
+
// Call commonHandleCommand directly
|
|
71
|
+
await commonHandleCommand(collector, 'destination', mockDestination, customConfig);
|
|
72
|
+
// Destination should be added with config
|
|
73
|
+
expect(collector.destinations['cmd-test']).toBeDefined();
|
|
74
|
+
expect(collector.destinations['cmd-test'].config).toEqual(customConfig);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=handle.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.test.js","sourceRoot":"","sources":["../../src/__tests__/handle.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,IAAI,mBAA8B,CAAC;IACnC,IAAI,mBAA8B,CAAC;IACnC,IAAI,eAAqC,CAAC;IAE1C,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAChC,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QAEpE,eAAe,GAAG;YAChB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,mBAAmB;SAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAC1C,IAAI,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;YACjD,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,SAAS,CAAC,EAAE,CAAC,CAAC;YAE/C,4BAA4B;YAC5B,MAAM,CAAC,MAAM,CAA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