mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
14 lines
448 B
TypeScript
14 lines
448 B
TypeScript
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')
|
|
})
|
|
})
|