website refactor
This commit is contained in:
@@ -30,6 +30,10 @@ describe('AnalyticsService', () => {
|
||||
const result = await service.recordPageView(input);
|
||||
|
||||
expect(mockApiClient.recordPageView).toHaveBeenCalledWith({
|
||||
entityType: 'page',
|
||||
entityId: '/dashboard',
|
||||
visitorType: 'user',
|
||||
sessionId: 'temp-session',
|
||||
path: '/dashboard',
|
||||
userId: 'user-123',
|
||||
});
|
||||
@@ -48,6 +52,10 @@ describe('AnalyticsService', () => {
|
||||
const result = await service.recordPageView(input);
|
||||
|
||||
expect(mockApiClient.recordPageView).toHaveBeenCalledWith({
|
||||
entityType: 'page',
|
||||
entityId: '/home',
|
||||
visitorType: 'guest',
|
||||
sessionId: 'temp-session',
|
||||
path: '/home',
|
||||
});
|
||||
expect(result).toBeInstanceOf(RecordPageViewOutputViewModel);
|
||||
@@ -69,6 +77,11 @@ describe('AnalyticsService', () => {
|
||||
const result = await service.recordEngagement(input);
|
||||
|
||||
expect(mockApiClient.recordEngagement).toHaveBeenCalledWith({
|
||||
action: 'button_click',
|
||||
entityType: 'ui_element',
|
||||
entityId: 'unknown',
|
||||
actorType: 'user',
|
||||
sessionId: 'temp-session',
|
||||
eventType: 'button_click',
|
||||
userId: 'user-123',
|
||||
metadata: { buttonId: 'submit', page: '/form' },
|
||||
@@ -89,6 +102,11 @@ describe('AnalyticsService', () => {
|
||||
const result = await service.recordEngagement(input);
|
||||
|
||||
expect(mockApiClient.recordEngagement).toHaveBeenCalledWith({
|
||||
action: 'page_load',
|
||||
entityType: 'ui_element',
|
||||
entityId: 'unknown',
|
||||
actorType: 'guest',
|
||||
sessionId: 'temp-session',
|
||||
eventType: 'page_load',
|
||||
});
|
||||
expect(result).toBeInstanceOf(RecordEngagementOutputViewModel);
|
||||
|
||||
Reference in New Issue
Block a user