fix(short-drama-agent-front): 完善素材准入与选角审核读取
This commit is contained in:
1 parent
75e86f7486
commit
3503926d62
13 files changed
+355
-42
No files matched your search
@@ -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)
|
||||
|
||||
@@ -1313,13 +1313,34 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true)
|
||||
})
|
||||
|
||||
it('Character 确认选角原子切换 Anchor 并锁定 Identity,不调用普通母版接口', async () => {
|
||||
it('Character 读取已保存审核后确认选角,刷新 Anchor、基础形态和项目准入', async () => {
|
||||
let locked = false
|
||||
let selected = false
|
||||
const candidate = identityImageFixture({ id: 'casting-1', isAnchor: false })
|
||||
const fingerprint = 'a'.repeat(64)
|
||||
const generationSource = 'b'.repeat(64)
|
||||
const validation = {
|
||||
...approvedCharacter(candidate.id),
|
||||
imageUrl: candidate.imageUrl,
|
||||
subjectFormId: 'form-db-1',
|
||||
providerInputFingerprint: fingerprint
|
||||
}
|
||||
const fetcher = vi.fn<typeof fetch>().mockImplementation(async (url, init) => {
|
||||
const path = String(url)
|
||||
if (path.endsWith('/subject-forms')) return jsonResponse([formFixture()])
|
||||
if (path.endsWith('/subject-forms')) {
|
||||
const form = formFixture()
|
||||
if (locked) {
|
||||
form.subject.identity = { id: candidate.identityId, isLocked: true, anchorImageId: candidate.id }
|
||||
form.images = [
|
||||
imageFixture({
|
||||
imageUrl: candidate.imageUrl,
|
||||
source: 'identity-anchor',
|
||||
identityAnchorImageId: candidate.id
|
||||
})
|
||||
]
|
||||
}
|
||||
return jsonResponse([form])
|
||||
}
|
||||
if (path.endsWith('/visual-style')) return jsonResponse(styleFixture())
|
||||
if (path.endsWith('/character-casting/readiness'))
|
||||
return jsonResponse({
|
||||
@@ -1345,8 +1366,24 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
]
|
||||
})
|
||||
if (path.endsWith('/identity/images')) return jsonResponse([{ ...candidate, isAnchor: selected }])
|
||||
if (init?.method === 'POST' && path.endsWith('/validate'))
|
||||
return jsonResponse(approvedCharacter(candidate.id))
|
||||
if (path.endsWith('/identity/images/casting-1'))
|
||||
return jsonResponse({
|
||||
...candidate,
|
||||
rawJson: JSON.stringify({
|
||||
sourceFingerprint: generationSource,
|
||||
providerInputFingerprint: fingerprint,
|
||||
providerInputSnapshot: { fingerprint },
|
||||
qualityValidation: {
|
||||
imageId: candidate.id,
|
||||
subjectFormId: 'form-db-1',
|
||||
sourceCurrent: true,
|
||||
generationSourceFingerprint: generationSource,
|
||||
providerInputFingerprint: fingerprint,
|
||||
passed: true,
|
||||
validation
|
||||
}
|
||||
})
|
||||
})
|
||||
if (init?.method === 'PUT' && path.endsWith('/casting')) {
|
||||
locked = true
|
||||
selected = true
|
||||
@@ -1360,12 +1397,14 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
return jsonResponse(identityFixture({ isLocked: locked }))
|
||||
})
|
||||
stubFetch(fetcher)
|
||||
await mountAssets('identity')
|
||||
const projectData = await mountAssets('identity')
|
||||
expect(wrapper!.text()).toContain('待确认选角')
|
||||
expect(wrapper!.find('.identity-anchor-grid').exists()).toBe(true)
|
||||
expect(button('确认选角并锁定').disabled).toBe(true)
|
||||
wrapper!.findComponent(IdentityGallery).vm.$emit('validate', candidate.id)
|
||||
button('查看已保存审核').click()
|
||||
await flushPromises()
|
||||
expect(wrapper!.text()).toContain('画面交付要求')
|
||||
expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true)
|
||||
button('确认选角并锁定').click()
|
||||
await flushPromises()
|
||||
button('确认演员选择').click()
|
||||
@@ -1373,6 +1412,12 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
const put = fetcher.mock.calls.find(([, init]) => init?.method === 'PUT')!
|
||||
expect(put[0]).toBe('/api/subjects/subject-db-1/identity/images/casting-1/casting')
|
||||
expect(fetcher.mock.calls.some(([url]) => String(url).endsWith('/anchor'))).toBe(false)
|
||||
const confirmationIndex = fetcher.mock.calls.indexOf(put)
|
||||
expect(
|
||||
fetcher.mock.calls.slice(confirmationIndex + 1).some(([url]) => String(url).endsWith('/subject-forms'))
|
||||
).toBe(true)
|
||||
expect(fetcher.mock.calls.some(([, init]) => init?.method === 'POST')).toBe(false)
|
||||
expect(projectData.refreshStageReadiness).toHaveBeenCalled()
|
||||
expect(wrapper!.text()).toContain('主体身份已完成')
|
||||
expect(wrapper!.get('.identity-gallery').text()).toContain('已确认并锁定')
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user