feat(router): add #/timelapse and #/ai-usage routes

This commit is contained in:
root
2026-06-08 14:49:32 +10:00
parent e01232e5f4
commit 8222717fd4
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import { JSDOM } from 'jsdom';
let current;
beforeAll(async () => {
const dom = new JSDOM('<!doctype html>', { url: 'http://localhost/#/' });
global.window = dom.window; global.document = dom.window.document; global.location = dom.window.location;
({ current } = await import('../../public/router.js'));
});
afterAll(() => { delete global.window; delete global.document; delete global.location; });
describe('router app routes', () => {
it('resolves #/timelapse', () => { location.hash = '#/timelapse'; expect(current().name).toBe('timelapse'); });
it('resolves #/ai-usage', () => { location.hash = '#/ai-usage'; expect(current().name).toBe('ai-usage'); });
});