feat: 同步最新生图与身份能力
This commit is contained in:
@@ -140,4 +140,59 @@ describe('镜头生产数据契约', () => {
|
||||
await flushPromises()
|
||||
expect(wrapper.emitted('generate')?.at(-1)).toEqual([{ setPrimary: false }])
|
||||
})
|
||||
|
||||
it('首帧生成前可预览后端最终选图规划和 Prompt', async () => {
|
||||
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
data: {
|
||||
shotId: 'shot-1',
|
||||
episodeNo: 1,
|
||||
beatNo: 1,
|
||||
shotNo: 1,
|
||||
provider: 'seedream',
|
||||
model: 'image-model',
|
||||
generationConfig: {},
|
||||
references: [],
|
||||
referencePlan: {
|
||||
provider: 'seedream',
|
||||
maxReferenceImages: 4,
|
||||
totalCandidates: 2,
|
||||
strategy: 'subject-coverage',
|
||||
selected: [
|
||||
{
|
||||
subjectRef: '@CH0001',
|
||||
module: 'character',
|
||||
role: 'identity-anchor',
|
||||
imageId: 'anchor-1'
|
||||
}
|
||||
],
|
||||
omitted: [
|
||||
{
|
||||
subjectRef: '@SC0001',
|
||||
module: 'scene',
|
||||
role: 'form-primary',
|
||||
imageId: 'scene-1'
|
||||
}
|
||||
]
|
||||
},
|
||||
providerPrompt: '最终首帧 Prompt'
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
wrapper = mount(KeyframeDialog, {
|
||||
attachTo: document.body,
|
||||
props: { open: true, shotId: 'shot-1', shotTitle: '开场', keyframes: [], disabled: false }
|
||||
})
|
||||
await flushPromises()
|
||||
button('预览实际生成输入').click()
|
||||
await flushPromises()
|
||||
expect(fetcher.mock.calls[0]?.[0]).toBe('/api/storyboard-shots/shot-1/keyframe/preview')
|
||||
expect(document.body.textContent).toContain('已选 1 / 2 张')
|
||||
expect(document.body.textContent).toContain('省略 1 张')
|
||||
expect(document.body.textContent).toContain('最终首帧 Prompt')
|
||||
expect(wrapper.emitted('generate')).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user