fix(short-drama-agent-front): 完善素材准入与选角审核读取

This commit is contained in:
GJ committed 2026-11-04 19:09:46 +08:00
1 parent 75e86f7486
commit 3503926d62
13 files changed
+355 -42

No files matched your search

+65
View File
@@ -422,6 +422,71 @@ describe('剧本完成前的下游访问限制', () => {
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/production"]`).exists()).toBe(false)
})
it('采用正式分镜后,导航与直达路由使用当前项目的素材准入,仍保留制作门禁', async () => {
const id = 'adopted-preparation'
const state = readiness(id)
state.breakdown = { ready: false, reason: '正式分镜尚未完成人工审核' }
state.subjectAssets = { ready: false, reason: '主体图片仍需准备' }
vi.mocked(projectsApi.stageReadiness).mockImplementation(async projectId =>
projectId === id ? state : readiness(id)
)
vi.spyOn(projectsApi, 'detail').mockImplementation(async projectId => project(projectId, 'completed'))
vi.spyOn(projectsApi, 'checkpoints').mockResolvedValue([
{
checkpointId: 'adopted',
workflowName: 'breakdown',
createdAt: '2026-10-01T10:00:00Z',
state: {
storyboardPersisted: true,
candidateCommitted: true,
workflowExecution: { executionId: 'old', status: 'failed', startedAt: '2026-10-01T09:00:00Z' }
}
}
])
const { router, mounted } = await openProject(`/projects/${id}/breakdown`)
for (const section of ['visual-style', 'subject-identity', 'subject-images']) {
await wrapper!.get(`.n-menu a[href="/projects/${id}/${section}"]`).trigger('click')
await flushPromises()
expect(wrapper!.get('.workspace-probe').text()).toBe(section)
}
await router.push(`/projects/${id}/production`)
await flushPromises()
expect(wrapper!.get('.project-access-gate').text()).toContain('正式分镜尚未完成人工审核')
expect(wrapper!.get('.n-menu [aria-disabled="true"][title="正式分镜尚未完成人工审核"]').text()).toContain(
'正式分镜尚未完成人工审核'
)
await router.push('/projects/other-project/subject-identity')
await flushPromises()
expect(wrapper!.find('.workspace-probe').exists()).toBe(false)
expect(wrapper!.find('.n-menu a[href="/projects/other-project/subject-identity"]').exists()).toBe(false)
expect(mounted.mock.calls.flat()).toEqual(['breakdown', 'visual-style', 'subject-identity', 'subject-images'])
})
it('候选未采用时,不以镜头存在推定素材准备通过', async () => {
const id = 'candidate-without-adoption'
const state = readiness(id)
state.preparation = { ready: false, reason: '请先采用当前候选分镜' }
state.breakdown = { ready: false, reason: '尚无正式分镜' }
vi.mocked(projectsApi.stageReadiness).mockResolvedValue(state)
vi.spyOn(projectsApi, 'detail').mockResolvedValue(project(id, 'completed'))
vi.spyOn(projectsApi, 'checkpoints').mockResolvedValue([
{
checkpointId: 'unadopted',
workflowName: 'breakdown',
createdAt: '2026-10-01T10:00:00Z',
state: {
candidateOnly: true,
storyboardPersisted: false,
storyboardShotValidation: { valid: true, issues: [] }
}
}
])
const { mounted } = await openProject(`/projects/${id}/subject-identity`)
expect(mounted).not.toHaveBeenCalled()
expect(wrapper!.get('.project-access-gate').text()).toContain('请先采用当前候选分镜')
expect(wrapper!.find(`.n-menu a[href="/projects/${id}/subject-identity"]`).exists()).toBe(false)
})
it('部分身份未齐备时可以逐项准备形态资料,但不能提前进入镜头设计或生产', async () => {
const id = 'partial-asset-preparation'
const state = readiness(id)