feat: add attributable page analytics
This commit is contained in:
@@ -148,6 +148,10 @@ function createSetup(overrides = {}) {
|
||||
calls.push(['owner-label', user]);
|
||||
return 'label';
|
||||
},
|
||||
resolveAnalyticsPlanFn(user) {
|
||||
calls.push(['plan-type', user]);
|
||||
return 'pro';
|
||||
},
|
||||
sendMindSpaceAnalyticsEventFn(event) {
|
||||
calls.push(['analytics', event]);
|
||||
return Promise.resolve();
|
||||
@@ -349,12 +353,18 @@ test('preserves generated-page analytics projection', async () => {
|
||||
ownerId: 'user-1',
|
||||
ownerSegment: 'segment',
|
||||
ownerLabel: 'label',
|
||||
planType: 'pro',
|
||||
generatedAt: analyticsCall[1].generatedAt,
|
||||
pageId: 'public/page.html',
|
||||
publicationId: 'session-1',
|
||||
agentRunId: 'session-1',
|
||||
channel: 'wechat_mp',
|
||||
url: 'https://example/page',
|
||||
});
|
||||
assert.match(
|
||||
analyticsCall[1].generatedAt,
|
||||
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/,
|
||||
);
|
||||
const rybbitCall = setup.calls.find(
|
||||
([name]) => name === 'rybbit',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user