feat(short-drama-agent-front): 完善视觉资产审核流程

This commit is contained in:
GJ committed 2026-11-04 14:09:21 +08:00
1 parent dc8bb17a23
commit b88ad8770f
45 files changed
+2258 -352

No files matched your search

+13 -1
View File
@@ -1,3 +1,4 @@
import { approvedCharacter } from '../../fixtures/image-preview'
import { imagePreviewFixture } from '../../fixtures/image-preview'
import { preparationFixture } from '../storyboard-preparation/fixtures'
import { generationProfile, imageCatalog } from '../../fixtures/generation'
@@ -1176,6 +1177,7 @@ describe('视觉风格与主体身份工作区', () => {
expect(getOperation(fixture.id).pending).toBe(true)
finish(
jsonResponse({
...approvedCharacter('identity-image-1'),
subjectId: 'subject-db-1',
imageId: 'identity-image-1',
passed,
@@ -1203,6 +1205,8 @@ describe('视觉风格与主体身份工作区', () => {
const fetcher = vi.fn<typeof fetch>().mockImplementation(async (url, init) => {
if (String(url).endsWith('/subject-forms')) return jsonResponse([form])
if (String(url).endsWith('/visual-style')) return jsonResponse(styleFixture())
if (init?.method === 'POST' && String(url).endsWith('/validate'))
return jsonResponse(approvedCharacter('candidate'))
if (init?.method === 'PUT') {
selected = true
return jsonResponse({
@@ -1219,10 +1223,13 @@ describe('视觉风格与主体身份工作区', () => {
stubFetch(fetcher)
await mountAssets('identity')
expect(wrapper!.find('.identity-anchor-grid').exists()).toBe(true)
expect(button('设为身份母版').disabled).toBe(true)
wrapper!.findComponent(IdentityGallery).vm.$emit('validate', 'candidate')
await flushPromises()
button('设为身份母版').click()
await flushPromises()
expect(fetcher.mock.calls.some(([, init]) => init?.method === 'PUT')).toBe(false)
button('确认切换身份母版').click()
button('确认费用并切换母版').click()
await flushPromises()
expect(fetcher.mock.calls.find(([, init]) => init?.method === 'PUT')?.[0]).toBe(
'/api/subjects/subject-db-1/identity/images/candidate/stable-anchor'
@@ -1338,6 +1345,8 @@ describe('视觉风格与主体身份工作区', () => {
]
})
if (path.endsWith('/identity/images')) return jsonResponse([{ ...candidate, isAnchor: selected }])
if (init?.method === 'POST' && path.endsWith('/validate'))
return jsonResponse(approvedCharacter(candidate.id))
if (init?.method === 'PUT' && path.endsWith('/casting')) {
locked = true
selected = true
@@ -1354,6 +1363,9 @@ describe('视觉风格与主体身份工作区', () => {
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)
await flushPromises()
button('确认选角并锁定').click()
await flushPromises()
button('确认演员选择').click()