mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
improved component composition and added tests.
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user