fix: 同步串联生产视频参数与数量限制
This commit is contained in:
1 parent
a85a740cd5
commit
112ff719ce
6 files changed
+68
-9
No files matched your search
@@ -52,6 +52,8 @@ describe('生产后端真实请求契约', () => {
|
||||
it('拒绝反向阶段、零值和非整数,支持主体图片结束阶段', () => {
|
||||
expect(validateProductionScope({ startFrom: 'videoPrompts', stopAfter: 'subjectImages' })).toContain('结束阶段')
|
||||
expect(validateProductionScope({ subjectImageLimit: 0 })).toContain('整数')
|
||||
expect(validateProductionScope({ videoLimit: 0 })).toContain('整数')
|
||||
expect(validateProductionScope({ videoLimit: 1.5 })).toContain('整数')
|
||||
expect(validateProductionScope({ stableIdentityAnchorLimit: 1.5 })).toContain('整数')
|
||||
expect(
|
||||
validateProductionScope({ startFrom: 'subjectImages', stopAfter: 'subjectImages', videoPromptLimit: 1 })
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user