chore: skill in query to file

This commit is contained in:
Joel
2026-03-26 16:17:50 +08:00
parent a1a527902b
commit 9c8a5ff527
5 changed files with 32 additions and 5 deletions

View File

@ -0,0 +1,17 @@
import { ViewType } from '@/app/components/workflow/types'
import { parseAsViewType } from '../search-params'
describe('workflow-app search params', () => {
it('should parse the new file view value and keep serializing it as file', () => {
expect(parseAsViewType.parse('file')).toBe(ViewType.file)
expect(parseAsViewType.serialize(ViewType.file)).toBe('file')
})
it('should keep supporting legacy skill view links by mapping them to file', () => {
expect(parseAsViewType.parse('skill')).toBe(ViewType.file)
})
it('should reject unsupported view values', () => {
expect(parseAsViewType.parse('invalid-view')).toBeNull()
})
})