view data fixes
This commit is contained in:
@@ -87,8 +87,8 @@ describe('AnalyticsService', () => {
|
||||
metadata: { buttonId: 'submit', page: '/form' },
|
||||
});
|
||||
expect(result).toBeInstanceOf(RecordEngagementOutputViewModel);
|
||||
expect(result.eventId).toEqual('event-123');
|
||||
expect(result.engagementWeight).toEqual(1.5);
|
||||
expect(result.eventId).toEqual(expectedOutput.eventId);
|
||||
expect(result.engagementWeight).toEqual(expectedOutput.engagementWeight);
|
||||
});
|
||||
|
||||
it('should call apiClient.recordEngagement without optional fields', async () => {
|
||||
@@ -110,8 +110,8 @@ describe('AnalyticsService', () => {
|
||||
eventType: 'page_load',
|
||||
});
|
||||
expect(result).toBeInstanceOf(RecordEngagementOutputViewModel);
|
||||
expect(result.eventId).toEqual('event-456');
|
||||
expect(result.engagementWeight).toEqual(0.5);
|
||||
expect(result.eventId).toEqual(expectedOutput.eventId);
|
||||
expect(result.engagementWeight).toEqual(expectedOutput.engagementWeight);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -30,7 +30,7 @@ export class AnalyticsService implements Service {
|
||||
sessionId: 'temp-session', // Should come from a session service
|
||||
...input
|
||||
});
|
||||
return new RecordPageViewOutputViewModel(data);
|
||||
return new RecordPageViewOutputViewModel(data as any);
|
||||
}
|
||||
|
||||
async recordEngagement(input: { eventType: string; userId?: string; metadata?: Record<string, any> }): Promise<RecordEngagementOutputViewModel> {
|
||||
@@ -42,6 +42,6 @@ export class AnalyticsService implements Service {
|
||||
sessionId: 'temp-session', // Should come from a session service
|
||||
...input
|
||||
});
|
||||
return new RecordEngagementOutputViewModel(data);
|
||||
return new RecordEngagementOutputViewModel(data as any);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user