Files
SubMiner/src/main/runtime/notification-routing.test.ts
T
sudacode cf16587547 feat(overlay): add loading OSD spinner and queue notifications until ren
- Show mpv OSD spinner from start-file until subminer-overlay-loading-ready; force-shown for visible-overlay startup regardless of osd_messages setting
- Gate non-macOS overlay visibility on content-ready so first subtitle line is immediately hoverable and clickable
- Queue startup notifications in main process until overlay window finishes loading; upsert progress cards by id to avoid cold-start floods
- Defer background warmups until after overlay runtime init so queued notifications can deliver promptly
- Preserve character dictionary checking/building/importing/ready phases as distinct history entries; route building and importing to system notifications when notificationType is both
2026-06-10 00:09:05 -07:00

30 lines
1.1 KiB
TypeScript

import assert from 'node:assert/strict';
import test from 'node:test';
import {
resolveOverlayReadinessNotificationType,
shouldShowDesktop,
shouldShowOverlay,
shouldShowOsd,
} from './notification-routing';
test('notification routing preserves system notification while overlay is not ready', () => {
assert.equal(resolveOverlayReadinessNotificationType('system', false), 'system');
});
test('notification routing preserves both while overlay is not ready', () => {
assert.equal(resolveOverlayReadinessNotificationType('both', false), 'both');
});
test('notification routing preserves overlay-only notification while overlay is not ready', () => {
assert.equal(resolveOverlayReadinessNotificationType('overlay', false), 'overlay');
});
test('notification routing predicates classify delivery channels', () => {
assert.equal(shouldShowOverlay('both'), true);
assert.equal(shouldShowOverlay('system'), false);
assert.equal(shouldShowOsd('osd-system'), true);
assert.equal(shouldShowOsd('both'), false);
assert.equal(shouldShowDesktop('osd-system'), true);
assert.equal(shouldShowDesktop('overlay'), false);
});