This commit is contained in:
13
tests/unit/ExplainNavigation.spec.ts
Normal file
13
tests/unit/ExplainNavigation.spec.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { explainGuideStopListUrl } from '@/utils/explainNavigation'
|
||||
|
||||
describe('explain navigation', () => {
|
||||
it('builds the hall-only guide-object URL', () => {
|
||||
const url = explainGuideStopListUrl('hall-1', '恐龙厅')
|
||||
expect(url.split('?')[0]).toBe('/pages/explain/guide-stop-list')
|
||||
const params = new URLSearchParams(url.split('?')[1])
|
||||
expect(params.get('hallId')).toBe('hall-1')
|
||||
expect(params.get('hallName')).toBe('恐龙厅')
|
||||
expect(params.has('unitId')).toBe(false)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user