feat(dashboard): close legacy parity gaps

This commit is contained in:
jjbrunton committed 2026-08-08 15:41:34 +01:00
1 parent 92287c0a9a
commit 4b3f00729f
21 files changed
+397 -28

No files matched your search

@@ -17,6 +17,7 @@ import {
MediaResponseSchema,
MediaSyncStatusSchema,
MessagesResponseSchema,
ProcessedPostsResponseSchema,
StatsResponseSchema,
StrategyPerformanceResponseSchema,
SubredditPerformanceResponseSchema,
@@ -103,6 +104,13 @@ describe('dashboard endpoint contracts', () => {
expect(TimersResponseSchema.safeParse({ hourlyResetAt: 'later' }).success).toBe(false);
expect(ActivityResponseSchema.safeParse([{ ...activity, type: 'bogus' }]).success).toBe(false);
expect(MessagesResponseSchema.safeParse([{ id: '1' }]).success).toBe(false);
const processedPost = {
id: 'post-1', subreddit: 'example', author: 'alice', title: 'Example',
imageUrl: null, imageAnalysis: null, generatedMessage: 'Hello',
processedAt: 1_700_000_000_000, messageSent: true, error: null,
};
expect(ProcessedPostsResponseSchema.safeParse([processedPost]).success).toBe(true);
expect(ProcessedPostsResponseSchema.safeParse([{ ...processedPost, messageSent: 'yes' }]).success).toBe(false);
});
it('validates each analytics response shape', () => {