发布 0.2.1 并完善工具边界与安全性
This commit is contained in:
@@ -95,4 +95,28 @@ describe('deployment configuration', () => {
|
||||
expect(agentGuide).toContain('git status --short --branch')
|
||||
expect(completeReadme).toContain('## AI 接手清单')
|
||||
})
|
||||
|
||||
it('keeps the management page under the reserved tools namespace', async () => {
|
||||
const router = await readProjectFile('src/router.ts')
|
||||
|
||||
expect(router).toContain("path: '/tools/setting'")
|
||||
expect(router).not.toContain("path: '/setting'")
|
||||
})
|
||||
|
||||
it('uses the UTF-8 / Hex tool ID as the canonical default route', async () => {
|
||||
const [router, catalogText, navigationText, registry] = await Promise.all([
|
||||
readProjectFile('src/router.ts'),
|
||||
readProjectFile('shared/tool-catalog.json'),
|
||||
readProjectFile('shared/default-navigation.json'),
|
||||
readProjectFile('src/tools/registry.ts'),
|
||||
])
|
||||
const catalog = JSON.parse(catalogText)
|
||||
const navigation = JSON.parse(navigationText)
|
||||
|
||||
expect(catalog.tools.find(({ title }) => title === 'UTF-8 / Hex')?.id).toBe('utf8-hex')
|
||||
expect(navigation.categories.flatMap(({ tools }) => tools)).toContain('utf8-hex')
|
||||
expect(router).toContain("redirect: '/tools/utf8-hex'")
|
||||
expect(router).not.toContain("'/tools/ascii-hex'")
|
||||
expect(registry).toContain("'utf8-hex': defineAsyncComponent(() => import('./Utf8HexTool.vue'))")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user