From 265d73c2554e293ee42fa36fa5fa7336f2c29df5 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 10 Jul 2026 15:47:20 +0800 Subject: [PATCH] test: guard prototype mock data boundaries --- frontend/src/features/prototype/mockData.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/features/prototype/mockData.test.ts b/frontend/src/features/prototype/mockData.test.ts index ff3610f..6176d79 100644 --- a/frontend/src/features/prototype/mockData.test.ts +++ b/frontend/src/features/prototype/mockData.test.ts @@ -20,7 +20,11 @@ describe('Stage A 演示数据', () => { }) it('保持可信边界和引用完整性', () => { - expect(mcpTools.filter((tool) => tool.access_mode === 'write').every((tool) => tool.requires_human_confirm)).toBe(true) + const writeTools = mcpTools.filter((tool) => tool.access_mode === 'write') + + expect(writeTools.length).toBeGreaterThan(0) + expect(writeTools.every((tool) => tool.requires_human_confirm)).toBe(true) + expect(knowledgeReferences.length).toBeGreaterThan(0) expect(knowledgeReferences.every((reference) => reference.score >= 0 && reference.score <= 1)).toBe(true) }) })