improved component composition and added tests.

This commit is contained in:
Moon.eth
2026-07-29 10:30:28 +09:00
parent 95f9d73681
commit 264ae17a8d
39 changed files with 1811 additions and 147 deletions
+13
View File
@@ -0,0 +1,13 @@
import { describe, expect, it } from 'vitest'
import { parseHash } from './router.svelte'
describe('parseHash', () => {
it('decodes valid route parameters', () => {
expect(parseHash('#/@alice%40remote.test').params.acct).toBe('alice@remote.test')
})
it('treats malformed percent escapes as not found', () => {
expect(() => parseHash('#/@broken%ZZ')).not.toThrow()
expect(parseHash('#/@broken%ZZ').name).toBe('notfound')
})
})