view data fixes
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 7m11s
Contract Testing / contract-snapshot (pull_request) Has been skipped

This commit is contained in:
2026-01-24 23:29:55 +01:00
parent c1750a33dd
commit 1b0a1f4aee
134 changed files with 10380 additions and 415 deletions

View File

@@ -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);
});
});
});

View File

@@ -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);
}
}