From beb39479f2aef6aaaf35b8dff3b6ae5913090716 Mon Sep 17 00:00:00 2001 From: GouJ Date: Thu, 15 Oct 2026 19:42:08 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E9=AA=8C=E8=AF=81=E6=89=8B=E9=83=A8?= =?UTF-8?q?=E8=AF=8A=E6=96=AD=E6=8C=89=E9=9C=80=E6=9F=A5=E8=AF=A2=E4=B8=8E?= =?UTF-8?q?=E8=AF=81=E6=8D=AE=E4=B8=8D=E8=B6=B3=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/breakdown/BreakdownPage.test.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/features/breakdown/BreakdownPage.test.ts b/tests/features/breakdown/BreakdownPage.test.ts index 70a6a99..3f48612 100644 --- a/tests/features/breakdown/BreakdownPage.test.ts +++ b/tests/features/breakdown/BreakdownPage.test.ts @@ -451,6 +451,33 @@ describe('拆解页内容滚动', () => { expect(drawerPanel().text()).toContain('重试失败抽取') }) + it('手部质量诊断仅在点击后请求,并展示证据不足状态', async () => { + const fetcher = vi.fn().mockResolvedValue(new Response(JSON.stringify({ + data: { + projectId: 'breakdown-scroll-test', episodeCount: 1, + shotCount: 25, validSnapshotCount: 25, + evidenceShotCount: 0, invalidEvidenceShotCount: 0, + missingEvidenceShotCount: 25, evidenceCoverage: 0, + assessment: 'insufficient_evidence', warningCount: 0, + diagnostics: [], willCallModel: false, willModifyAssets: false + } + }), { status: 200, headers: { 'Content-Type': 'application/json' } })) + vi.stubGlobal('fetch', fetcher) + mountPage() + await wrapper!.get('[data-workspace-tools]').trigger('click') + await flushPromises() + expect(fetcher).not.toHaveBeenCalled() + const panel = drawerPanel() + const action = panel.findAll('button').find(button => button.text() === '查看诊断') + expect(action).toBeDefined() + await action!.trigger('click') + await flushPromises() + expect(fetcher).toHaveBeenCalledTimes(1) + expect(String(fetcher.mock.calls[0]?.[0])).toContain('/breakdown/storyboard-hand-occupancy-diagnostics') + expect(panel.text()).toContain('有效证据 0 / 25') + expect(panel.text()).toContain('证据不足') + }) + it('没有正式剧集时保留可滚动的空状态,不显示拆解设置与结果', () => { mountPage([], 0) expect(wrapper!.get('.panel-scroll .n-scrollbar-container').text()).toContain('还没有可拆解的剧集')