fix: 同步串联生产视频参数与数量限制

This commit is contained in:
GJ committed 2026-10-10 13:08:11 +08:00
1 parent a85a740cd5
commit 112ff719ce
6 files changed
+68 -9

No files matched your search

+25 -2
View File
@@ -124,7 +124,8 @@ function server() {
const fetcher = vi.fn<typeof fetch>().mockImplementation(async (url, init) => {
const path = String(url)
let data: unknown = context.project.value
if (path.endsWith('/creative-profile')) data = generationProfile('capability-test')
if (path.endsWith('/creative-profile'))
data = { ...generationProfile('capability-test'), videoOptions: { resolution: '720p' } }
else if (path.includes('/workflow-executions/'))
data = {
id: 'capability-execution-1',
@@ -222,14 +223,36 @@ describe('高级串联生产的安全边界', () => {
subjectImageLimit: 1,
keyframeLimit: 1,
videoPromptLimit: 1,
videoLimit: 1,
imageProvider: 'qwen-image',
videoProvider: 'seedance',
imageGenerationOptions: { size: '2048*2048' }
imageGenerationOptions: { size: '2048*2048' },
videoGenerationOptions: { resolution: '720p' }
})
expect(fetcher.mock.calls.filter(([url]) => String(url).endsWith('/production/plan'))).toHaveLength(2)
expect(service.session.value.pipelineReceipt?.errors).toEqual(['一个提示词未生成'])
expect(service.check.value).toBeNull()
})
it('预检后视频参数变化会撤销旧确认,避免提交未经确认的参数', async () => {
const { service, fetcher, posts } = await advanced()
await service.preflight()
const original = fetcher.getMockImplementation()!
fetcher.mockImplementation((url, init) =>
String(url).endsWith('/creative-profile')
? Promise.resolve(
new Response(
JSON.stringify({
data: { ...generationProfile('capability-test'), videoOptions: { resolution: '1080p' } }
})
)
)
: original(url, init)
)
await service.start()
expect(posts()).toHaveLength(0)
expect(service.check.value).toBeNull()
expect(getOperation('capability-test').error).toContain('参数已变化')
})
it('预检后新增活动任务,确认时重新检查并阻止重复提交', async () => {
const { service, readiness, posts } = await advanced()
await service.preflight()