Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(tests): ensure email channel is registered before sending notifications

Luffyba562c904715
diff --git a/server/tests/unit/nest/notification-transports.test.ts b/server/tests/unit/nest/notification-transports.test.ts
index 6337811cd..1d1759a87 100644
--- a/server/tests/unit/nest/notification-transports.test.ts
+++ b/server/tests/unit/nest/notification-transports.test.ts
@@ -318,7 +318,8 @@ describe('built-in email manage link scope', () => {
webhook: {} as never,
ntfy: {} as never,
push: {} as never,
- }).find((channel) => channel.id === 'email')!;
+ }).find((channel) => channel.id === 'email');
+ if (!emailChannel) throw new Error('Expected the built-in email channel to be registered');
await emailChannel.sendToUser(1, { event: 'version_available', title: 'Update', body: 'New version' });
await emailChannel.sendToUser(1, { event: 'trip_invite', title: 'Invite', body: 'Join trip' });