fix(short-drama-agent-front): 修复代码格式检查问题
This commit is contained in:
1 parent
81d6a85260
commit
48fce3975f
87 files changed
+5714
-1436
No files matched your search
@@ -10,21 +10,61 @@ import type { LegacyActionDiagnosisResults } from '@/features/breakdown/types'
|
||||
import type { WorkflowExecution } from '@/features/workflows/execution.types'
|
||||
|
||||
/** 页面回执同时包含修订完成、局部证据不足和 AI 待复查。 */
|
||||
const shot: LegacyActionDiagnosisResults['shots'][number] = { shotId: 'shot-1', episodeNo: 1, beatNo: 1, shotNo: 1, title: '捂耳取铃', diagnosisId: 'diag-1', status: 'stale' as const, issues: [], createdAt: null,
|
||||
policyStatus: 'stale', shotStale: true, repairStatus: 'repaired', requiresPostRepairDiagnosis: true,
|
||||
handAudit: { status: 'partial_evidence', evidenceCount: 1, expectedActionCount: 2, coveredActionCount: 1, issueCount: 0, coverage: 0.5 },
|
||||
bodyMotionFindings: [{ dimension: 'balance', status: 'needs_review', description: '重心需要核对', quote: '单脚站立' }] }
|
||||
const shot: LegacyActionDiagnosisResults['shots'][number] = {
|
||||
shotId: 'shot-1',
|
||||
episodeNo: 1,
|
||||
beatNo: 1,
|
||||
shotNo: 1,
|
||||
title: '捂耳取铃',
|
||||
diagnosisId: 'diag-1',
|
||||
status: 'stale' as const,
|
||||
issues: [],
|
||||
createdAt: null,
|
||||
policyStatus: 'stale',
|
||||
shotStale: true,
|
||||
repairStatus: 'repaired',
|
||||
requiresPostRepairDiagnosis: true,
|
||||
handAudit: {
|
||||
status: 'partial_evidence',
|
||||
evidenceCount: 1,
|
||||
expectedActionCount: 2,
|
||||
coveredActionCount: 1,
|
||||
issueCount: 0,
|
||||
coverage: 0.5
|
||||
},
|
||||
bodyMotionFindings: [
|
||||
{ dimension: 'balance', status: 'needs_review', description: '重心需要核对', quote: '单脚站立' }
|
||||
]
|
||||
}
|
||||
let wrapper: VueWrapper | undefined
|
||||
afterEach(() => { wrapper?.unmount(); wrapper = undefined; vi.restoreAllMocks(); vi.unstubAllGlobals(); document.body.innerHTML = '' })
|
||||
afterEach(() => {
|
||||
wrapper?.unmount()
|
||||
wrapper = undefined
|
||||
vi.restoreAllMocks()
|
||||
vi.unstubAllGlobals()
|
||||
document.body.innerHTML = ''
|
||||
})
|
||||
|
||||
describe('诊断版本及复查展示', () => {
|
||||
it('顶部摘要优先表达正式审核通过,不因没有额外 AI 记录提示分镜尚未诊断', async () => {
|
||||
const current = { ...shot, status: 'not_diagnosed' as const, policyStatus: 'not_diagnosed' as const, shotStale: false, bodyMotionFindings: [] }
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
|
||||
counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 1 }, shots: [current] })
|
||||
const current = {
|
||||
...shot,
|
||||
status: 'not_diagnosed' as const,
|
||||
policyStatus: 'not_diagnosed' as const,
|
||||
shotStale: false,
|
||||
bodyMotionFindings: []
|
||||
}
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({
|
||||
projectId: 'diag-update',
|
||||
episodeNo: 1,
|
||||
counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 1 },
|
||||
shots: [current]
|
||||
})
|
||||
const context = testProjectContext('diag-update')
|
||||
wrapper = mount(StoryboardDiagnosis, { props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: context } } })
|
||||
wrapper = mount(StoryboardDiagnosis, {
|
||||
props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: context } }
|
||||
})
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('分镜校验与审核已通过')
|
||||
expect(wrapper.text()).not.toContain('尚未诊断')
|
||||
@@ -38,27 +78,66 @@ describe('诊断版本及复查展示', () => {
|
||||
expect(wrapper.text()).not.toContain('分镜校验与审核已通过')
|
||||
})
|
||||
it('有当前真实问题时摘要仍明确提示处理,不被正式审核状态盖住', async () => {
|
||||
const current = { ...shot, status: 'conflict_found' as const, policyStatus: 'current' as const, shotStale: false, bodyMotionFindings: [] }
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
|
||||
counts: { total: 1, conflict: 1, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 0 }, shots: [current] })
|
||||
wrapper = mount(StoryboardDiagnosis, { props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: testProjectContext('diag-update') } } })
|
||||
const current = {
|
||||
...shot,
|
||||
status: 'conflict_found' as const,
|
||||
policyStatus: 'current' as const,
|
||||
shotStale: false,
|
||||
bodyMotionFindings: []
|
||||
}
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({
|
||||
projectId: 'diag-update',
|
||||
episodeNo: 1,
|
||||
counts: { total: 1, conflict: 1, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 0 },
|
||||
shots: [current]
|
||||
})
|
||||
wrapper = mount(StoryboardDiagnosis, {
|
||||
props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: testProjectContext('diag-update') } }
|
||||
})
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('1 个镜头有实际问题待处理')
|
||||
expect(wrapper.text()).not.toContain('分镜校验与审核已通过')
|
||||
})
|
||||
|
||||
it('已修订并审核通过默认不列入需处理,可在可选复查中查看且没有修复按钮', async () => {
|
||||
const current = { ...shot, status: 'not_diagnosed' as const, policyStatus: 'not_diagnosed' as const,
|
||||
shotStale: false, bodyMotionFindings: [], handAudit: undefined,
|
||||
resourceAudit: { status: 'insufficient_evidence' as const, issueCount: 0, evidenceCount: 2, expectedActionCount: 0, coveredActionCount: 0, coverage: null } }
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
|
||||
counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 1 }, shots: [current] })
|
||||
vi.spyOn(breakdownApi, 'handOccupancyDiagnostics').mockResolvedValue({ projectId: 'diag-update', shotCount: 1, evidenceShotCount: 0, diagnostics: [] } as never)
|
||||
const current = {
|
||||
...shot,
|
||||
status: 'not_diagnosed' as const,
|
||||
policyStatus: 'not_diagnosed' as const,
|
||||
shotStale: false,
|
||||
bodyMotionFindings: [],
|
||||
handAudit: undefined,
|
||||
resourceAudit: {
|
||||
status: 'insufficient_evidence' as const,
|
||||
issueCount: 0,
|
||||
evidenceCount: 2,
|
||||
expectedActionCount: 0,
|
||||
coveredActionCount: 0,
|
||||
coverage: null
|
||||
}
|
||||
}
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({
|
||||
projectId: 'diag-update',
|
||||
episodeNo: 1,
|
||||
counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 1 },
|
||||
shots: [current]
|
||||
})
|
||||
vi.spyOn(breakdownApi, 'handOccupancyDiagnostics').mockResolvedValue({
|
||||
projectId: 'diag-update',
|
||||
shotCount: 1,
|
||||
evidenceShotCount: 0,
|
||||
diagnostics: []
|
||||
} as never)
|
||||
const start = vi.spyOn(breakdownApi, 'startLegacyActionDiagnosis')
|
||||
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: testProjectContext('diag-update') } } })
|
||||
await flushPromises(); await wrapper.get('button').trigger('click'); await flushPromises()
|
||||
wrapper = mount(StoryboardDiagnosis, {
|
||||
attachTo: document.body,
|
||||
props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: testProjectContext('diag-update') } }
|
||||
})
|
||||
await flushPromises()
|
||||
await wrapper.get('button').trigger('click')
|
||||
await flushPromises()
|
||||
const dialog = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
|
||||
expect(dialog.findAll('.diagnosis-result-item')).toHaveLength(0)
|
||||
expect(dialog.text()).toContain('当前正式分镜已审核通过')
|
||||
@@ -73,12 +152,28 @@ describe('诊断版本及复查展示', () => {
|
||||
})
|
||||
|
||||
it('修订完成不显示全部通过,展示规则和镜头过期、手部覆盖及全身疑点', async () => {
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1, counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 1, pending: 0 }, shots: [shot] })
|
||||
vi.spyOn(breakdownApi, 'handOccupancyDiagnostics').mockResolvedValue({ projectId: 'diag-update', shotCount: 1, evidenceShotCount: 0, diagnostics: [] } as never)
|
||||
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] } })
|
||||
await flushPromises(); await wrapper.get('button').trigger('click'); await flushPromises()
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({
|
||||
projectId: 'diag-update',
|
||||
episodeNo: 1,
|
||||
counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 1, pending: 0 },
|
||||
shots: [shot]
|
||||
})
|
||||
vi.spyOn(breakdownApi, 'handOccupancyDiagnostics').mockResolvedValue({
|
||||
projectId: 'diag-update',
|
||||
shotCount: 1,
|
||||
evidenceShotCount: 0,
|
||||
diagnostics: []
|
||||
} as never)
|
||||
wrapper = mount(StoryboardDiagnosis, {
|
||||
attachTo: document.body,
|
||||
props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] }
|
||||
})
|
||||
await flushPromises()
|
||||
await wrapper.get('button').trigger('click')
|
||||
await flushPromises()
|
||||
const dialog = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
|
||||
wrapper!.getComponent(NSelect).vm.$emit('update:value', 'review'); await flushPromises()
|
||||
wrapper!.getComponent(NSelect).vm.$emit('update:value', 'review')
|
||||
await flushPromises()
|
||||
expect(dialog.text()).toContain('镜头已修订,可按需进行 AI 复查。')
|
||||
expect(dialog.text()).toContain('镜头内容已变化')
|
||||
expect(dialog.text()).toContain('质量规则已变化')
|
||||
@@ -87,8 +182,32 @@ describe('诊断版本及复查展示', () => {
|
||||
expect(dialog.text()).not.toContain('全部通过')
|
||||
})
|
||||
it('中断诊断显示人工核查与可复用数量,不把未匹配镜头描述为未计费', () => {
|
||||
const execution = { id: 'task', projectId: 'p', workflowName: 'storyboard-legacy-action-diagnosis', status: 'failed', current: 1, total: 3,
|
||||
result: { recoveryRequired: true, retryAutomatically: false, requiresManualReview: true, resumeMode: 'manual', reusableShotCount: 1, manualReviewShotCount: 2, scopedShotCount: 3, qualityPolicyVerified: true }, metadata: null, stage: 'interrupted', currentResourceId: null, error: '诊断中断', startedAt: null, completedAt: null, createdAt: '', updatedAt: '' } satisfies WorkflowExecution
|
||||
const execution = {
|
||||
id: 'task',
|
||||
projectId: 'p',
|
||||
workflowName: 'storyboard-legacy-action-diagnosis',
|
||||
status: 'failed',
|
||||
current: 1,
|
||||
total: 3,
|
||||
result: {
|
||||
recoveryRequired: true,
|
||||
retryAutomatically: false,
|
||||
requiresManualReview: true,
|
||||
resumeMode: 'manual',
|
||||
reusableShotCount: 1,
|
||||
manualReviewShotCount: 2,
|
||||
scopedShotCount: 3,
|
||||
qualityPolicyVerified: true
|
||||
},
|
||||
metadata: null,
|
||||
stage: 'interrupted',
|
||||
currentResourceId: null,
|
||||
error: '诊断中断',
|
||||
startedAt: null,
|
||||
completedAt: null,
|
||||
createdAt: '',
|
||||
updatedAt: ''
|
||||
} satisfies WorkflowExecution
|
||||
wrapper = mount(WorkflowExecutionPanel, { props: { execution, loading: false, error: '' } })
|
||||
expect(wrapper.text()).toContain('需要人工核查')
|
||||
expect(wrapper.text()).toContain('可复用 1 镜')
|
||||
|
||||
Reference in new issue
Block a user