just testing the environment
Some checks failed
Tests / test (push) Has been cancelled

This commit is contained in:
tom.hempel
2026-05-20 07:10:08 +02:00
parent 2a11dfd0d1
commit 06fc134299
56 changed files with 1890 additions and 361 deletions

View File

@ -0,0 +1,33 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { navigate, currentHash, matchRoute } from '../../js/router.js';
describe('router', () => {
beforeEach(() => {
window.location.hash = '';
});
it('currentHash defaults to / when empty', () => {
window.location.hash = '';
expect(currentHash()).toBe('/');
});
it('currentHash strips leading hash', () => {
window.location.hash = '#/dashboard';
expect(currentHash()).toBe('/dashboard');
});