moving
Some checks failed
Installer Smoke / installer-smoke (push) Has been cancelled

This commit is contained in:
Oleg Maslov
2026-09-02 10:10:29 +02:00
commit 0c3e2ead3b
3841 changed files with 970576 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import { describe, it, expect } from 'vitest';
describe('Notification SSE Route', () => {
it('exports notificationRoutes function', async () => {
const mod = await import('../../src/local/routes/notifications.js');
expect(mod.notificationRoutes).toBeDefined();
expect(typeof mod.notificationRoutes).toBe('function');
});
it('exports emitNotification function', async () => {
const mod = await import('../../src/local/routes/notifications.js');
expect(mod.emitNotification).toBeDefined();
expect(typeof mod.emitNotification).toBe('function');
});
});
describe('NotificationEvent shape', () => {
it('has required fields', () => {
const event = {
type: 'notification' as const,
title: 'Test',
body: 'Test body',
category: 'cron' as const,
timestamp: new Date().toISOString(),
};
expect(event.type).toBe('notification');
expect(event.category).toBe('cron');
});
it('supports optional actionUrl', () => {
const event = {
type: 'notification' as const,
title: 'Task',
body: 'Review Q1',
category: 'task' as const,
timestamp: new Date().toISOString(),
actionUrl: '/tasks',
};
expect(event.actionUrl).toBe('/tasks');
});
});