Add category discriminator to notification content fixtures

The generated MessageNotificationContent schema now includes the
category: "message" discriminator, so content literals in
Partial<UserNotification> overrides no longer narrow without it.
This commit is contained in:
mvdbeek
2026-04-28 17:17:17 +02:00
parent 2515edacfc
commit 079d4ce52d
+2 -2
View File
@@ -34,7 +34,7 @@ function makeNotificationFixture(overrides: Partial<UserNotification> = {}): Use
expiration_time: null,
seen_time: null,
deleted: false,
content: { subject: "hello", message: "welcome" },
content: { category: "message", subject: "hello", message: "welcome" },
...overrides,
} as UserNotification;
}
@@ -136,7 +136,7 @@ describe("notificationsStore — config-driven SSE vs polling", () => {
const pushed = makeNotificationFixture({
id: "notif-2",
content: { subject: "pushed via sse", message: "hi" },
content: { category: "message", subject: "pushed via sse", message: "hi" },
});
emitSse(sseState, "notification_update", pushed);
await flushPromises();