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('还没有可拆解的剧集')