feat: 按质量结果管理主首帧候选
This commit is contained in:
1 parent
a72d96506a
commit
4298438219
6 files changed
+243
-88
No files matched your search
@@ -136,10 +136,10 @@ describe('镜头生产数据契约', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('首个首帧默认设主图,已有主图时默认只新增候选,并要求费用确认', async () => {
|
||||
it('所有首帧生成都先成为候选,并要求费用确认', async () => {
|
||||
wrapper = mount(KeyframeDialog, {
|
||||
attachTo: document.body,
|
||||
props: { open: true, shotId: 'shot-1', shotTitle: '开场', keyframes: [], disabled: false }
|
||||
props: { open: true, shotId: 'shot-1', shotTitle: '开场', disabled: false }
|
||||
})
|
||||
await flushPromises()
|
||||
expect(button('确认生成首帧').disabled).toBe(true)
|
||||
@@ -147,12 +147,13 @@ describe('镜头生产数据契约', () => {
|
||||
await flushPromises()
|
||||
button('确认生成首帧').click()
|
||||
await flushPromises()
|
||||
expect(wrapper.emitted('generate')).toEqual([[{ setPrimary: true }]])
|
||||
expect(wrapper.emitted('generate')).toEqual([[{ setPrimary: false }]])
|
||||
|
||||
await wrapper.setProps({ open: false })
|
||||
await flushPromises()
|
||||
await wrapper.setProps({ open: true, shotId: 'shot-2', keyframes: [keyframeFixture({ shotId: 'shot-2' })] })
|
||||
await wrapper.setProps({ open: true, shotId: 'shot-2', replacePrimary: true })
|
||||
await flushPromises()
|
||||
expect(document.body.textContent).toContain('生成替代候选')
|
||||
document.querySelector<HTMLInputElement>('#confirm-keyframe-cost')!.click()
|
||||
await flushPromises()
|
||||
button('确认生成首帧').click()
|
||||
@@ -203,7 +204,7 @@ describe('镜头生产数据契约', () => {
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
wrapper = mount(KeyframeDialog, {
|
||||
attachTo: document.body,
|
||||
props: { open: true, shotId: 'shot-1', shotTitle: '开场', keyframes: [], disabled: false }
|
||||
props: { open: true, shotId: 'shot-1', shotTitle: '开场', disabled: false }
|
||||
})
|
||||
await flushPromises()
|
||||
button('预览实际生成输入').click()
|
||||
|
||||
Reference in new issue
Block a user