feat(short-drama-agent-front): 完善分镜审核与制作准备流程

This commit is contained in:
GJ committed 2026-10-19 21:59:22 +08:00
1 parent c4b43b9725
commit 1da56e0d46
72 files changed
+2801 -528

No files matched your search

@@ -6,7 +6,7 @@ import type { ProductionStartInput } from '@/features/production/types'
afterEach(() => vi.unstubAllGlobals())
describe('生产后端真实请求契约', () => {
it('计划使用 POST JSON 并将图片参数与启动保持同源', async () => {
it('计划保持 POST 且只发送支持的模型参数,启动另外携带执行范围和视频参数', async () => {
const fetchMock = vi
.fn<typeof fetch>()
.mockImplementation(async () => new Response(JSON.stringify({ data: { projectId: 'p' } })))
@@ -15,6 +15,7 @@ describe('生产后端真实请求契约', () => {
imageProvider: 'qwen-image',
imageGenerationOptions: { size: '1024*1024', seed: 3 },
videoProvider: 'wan',
videoGenerationOptions: { duration: -1, resolution: '720p' },
startFrom: 'subjectImages',
stopAfter: 'videoPrompts',
stableIdentityAnchorLimit: 1,
@@ -27,10 +28,13 @@ describe('生产后端真实请求契约', () => {
await productionApi.startPipeline('p', input)
expect(fetchMock.mock.calls[0]?.[0]).toBe('/api/projects/p/production/plan')
expect(fetchMock.mock.calls[1]?.[0]).toBe('/api/projects/p/production/start')
for (const [, request] of fetchMock.mock.calls) {
expect(request?.method).toBe('POST')
expect(JSON.parse(String(request?.body))).toEqual(input)
}
expect(fetchMock.mock.calls.every(([, request]) => request?.method === 'POST')).toBe(true)
expect(JSON.parse(String(fetchMock.mock.calls[0]?.[1]?.body))).toEqual({
imageProvider: input.imageProvider,
imageGenerationOptions: input.imageGenerationOptions,
videoProvider: input.videoProvider
})
expect(JSON.parse(String(fetchMock.mock.calls[1]?.[1]?.body))).toEqual(input)
expect(fetchMock.mock.calls[0]?.[1]?.signal).toBeInstanceOf(AbortSignal)
})