feat(analytics): add clickhouse (#11174)
This commit is contained in:
19
packages/twenty-server/test/utils/analytics-context.mock.ts
Normal file
19
packages/twenty-server/test/utils/analytics-context.mock.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { TrackEventName } from 'src/engine/core-modules/analytics/types/events.type';
|
||||
|
||||
export const AnalyticsContextMock = (params?: {
|
||||
track?:
|
||||
| ((
|
||||
event: TrackEventName,
|
||||
properties: any,
|
||||
) => Promise<{ success: boolean }>)
|
||||
| jest.Mock<any, any>;
|
||||
pageview?:
|
||||
| ((name: string, properties: any) => Promise<{ success: boolean }>)
|
||||
| jest.Mock<any, any>;
|
||||
}) => {
|
||||
return {
|
||||
track: params?.track ?? jest.fn().mockResolvedValue({ success: true }),
|
||||
pageview:
|
||||
params?.pageview ?? jest.fn().mockResolvedValue({ success: true }),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user