feat(router): add #/timelapse and #/ai-usage routes
This commit is contained in:
15
tests/frontend/router.test.js
Normal file
15
tests/frontend/router.test.js
Normal 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'); });
|
||||
});
|
||||
Reference in New Issue
Block a user