feat(short-drama-agent-front): 完善分镜审核与制作准备流程
This commit is contained in:
1 parent
c4b43b9725
commit
1da56e0d46
72 files changed
+2801
-528
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { preparationFixture } from '../storyboard-preparation/fixtures'
|
||||
import { generationProfile, imageCatalog } from '../../fixtures/generation'
|
||||
import { routerLinkStubs } from '../../fixtures/router'
|
||||
import { computed, ref } from 'vue'
|
||||
@@ -99,6 +100,7 @@ function stubFetch(fetcher: Mock<typeof fetch>) {
|
||||
let executionCount = 0
|
||||
fetcher.mockImplementation(async (url, init) => {
|
||||
const path = String(url)
|
||||
if (path.endsWith('/storyboard/quality-confirmation')) { const current = preparationFixture(fixture.id); return jsonResponse({ ...current.approval, valid: true, confirmation: current.record }) }
|
||||
if (path.endsWith('/generation-models')) return jsonResponse(imageCatalog)
|
||||
if (path.endsWith('/creative-profile')) return jsonResponse(generationProfile(fixture.id))
|
||||
if (path.endsWith('/duration-budget'))
|
||||
@@ -1816,7 +1818,7 @@ describe('工作台页面交互', () => {
|
||||
expect(drawerPanel().text()).toContain('本集新镜头已保存')
|
||||
expect(drawerPanel().text()).toContain('2 个镜头')
|
||||
/** Duration Budget 新增一次只读 GET;镜头重生成不应增加额外写入。 */
|
||||
expect(fetcher.mock.calls.filter(([, init]) => !init?.method || init.method === 'GET')).toHaveLength(12)
|
||||
expect(fetcher.mock.calls.filter(([url, init]) => (!init?.method || init.method === 'GET') && !String(url).endsWith('/storyboard/quality-confirmation'))).toHaveLength(12)
|
||||
expect(fetcher.mock.calls.filter(([url]) => String(url).endsWith('/duration-budget'))).toHaveLength(2)
|
||||
expect(fetcher.mock.calls.some(([url]) => String(url) === '/api/workflow-executions/page-execution-1')).toBe(
|
||||
true
|
||||
@@ -1913,7 +1915,8 @@ describe('工作台页面交互', () => {
|
||||
expect(wrapper!.text()).toContain('第2集镜头1')
|
||||
expect(wrapper!.text()).not.toContain('第1集镜头1')
|
||||
/** 切换剧集只增加当前集查询,项目时长预算只在挂载时读取一次。 */
|
||||
expect(fetcher.mock.calls).toHaveLength(6)
|
||||
expect(fetcher.mock.calls.filter(([url]) => !String(url).endsWith('/storyboard/quality-confirmation'))).toHaveLength(6)
|
||||
expect(fetcher.mock.calls.filter(([url]) => String(url).endsWith('/storyboard/quality-confirmation'))).toHaveLength(1)
|
||||
expect(fetcher.mock.calls.filter(([url]) => String(url).endsWith('/duration-budget'))).toHaveLength(1)
|
||||
expect(fetcher.mock.calls.every(([, init]) => !init?.method || init.method === 'GET')).toBe(true)
|
||||
})
|
||||
@@ -2076,12 +2079,14 @@ describe('工作台页面交互', () => {
|
||||
})
|
||||
|
||||
it('修改每组集数会废弃预览,重新预览并确认后才能启动', async () => {
|
||||
let rulesConfirmed = false
|
||||
const fetcher = vi.fn<typeof fetch>().mockImplementation(async url => {
|
||||
if (String(url).includes('breakdown-preview'))
|
||||
return new Response(
|
||||
'{"data":{"episodeCount":1,"groupCount":1,"estimatedTaskCount":3,"groups":[],"tasks":[],"modules":["character","scene","prop"],"groupSize":2}}'
|
||||
)
|
||||
if (String(url).includes('quality-policy')) return new Response(JSON.stringify({ data: { projectId: 'page-test-project', policy: {
|
||||
if (String(url).endsWith('quality-policy/confirm')) rulesConfirmed = true
|
||||
if (String(url).includes('quality-policy')) return new Response(JSON.stringify({ data: { projectId: 'page-test-project', revision: 3, fingerprint: 'a'.repeat(64), confirmed: rulesConfirmed, confirmedRevision: rulesConfirmed ? 3 : null, confirmedAt: rulesConfirmed ? '2026-10-17T15:00:00Z' : null, policy: {
|
||||
version: 1, physicsMode: 'realistic', allowExaggeratedMotion: false, allowNonPhysicalActions: false, allowSupernaturalAbilities: false, customRules: []
|
||||
} } }))
|
||||
return new Response('{"data":{"workflowExecution":{"status":"completed"}}}')
|
||||
@@ -2109,9 +2114,10 @@ describe('工作台页面交互', () => {
|
||||
await flushPromises()
|
||||
button('确认生成拆解候选').click()
|
||||
await flushPromises()
|
||||
const post = fetcher.mock.calls.find(call => call[1]?.method === 'POST')
|
||||
const post = fetcher.mock.calls.find(call => call[1]?.method === 'POST' && String(call[0]).endsWith('/breakdown/start'))
|
||||
expect(post?.[0]).toBe('/api/projects/page-test-project/breakdown/start')
|
||||
expect(JSON.parse(post![1]!.body as string)).toEqual({
|
||||
expectedRevision: 3,
|
||||
groupSize: 2,
|
||||
modules: ['character', 'scene', 'prop'],
|
||||
candidateOnly: true
|
||||
|
||||
Reference in new issue
Block a user