feat(short-drama-agent-front): 接入素材预览审核并完善创作流程
This commit is contained in:
1 parent
f8b0fbb8ca
commit
dc8bb17a23
66 files changed
+2864
-632
No files matched your search
@@ -14,8 +14,11 @@ import { requiredTextRule } from '@/lib/form-rules'
|
||||
|
||||
/** 当前测试使用真实目录契约构造项目模型配置。 */
|
||||
const creativeProfile = generationProfile('gallery-test')
|
||||
/** 生成提交由测试替身接收,绝不调用真实模型。 */
|
||||
const submitGeneration = vi.fn<() => Promise<{ accepted: boolean }>>(async () => ({ accepted: true }))
|
||||
let wrapper: VueWrapper | undefined
|
||||
afterEach(() => {
|
||||
submitGeneration.mockClear()
|
||||
wrapper?.unmount()
|
||||
wrapper = undefined
|
||||
document.body.innerHTML = ''
|
||||
@@ -109,7 +112,14 @@ describe('统一的 Naive UI 表单校验', () => {
|
||||
it('图片尺寸采用目录必填枚举,切换目标清空提示词和费用确认', async () => {
|
||||
wrapper = mount(GenerateImageDialog, {
|
||||
attachTo: document.body,
|
||||
props: { open: true, form: formFixture(), disabled: false, catalog: imageCatalog, profile: creativeProfile }
|
||||
props: {
|
||||
submitGeneration,
|
||||
open: true,
|
||||
form: formFixture(),
|
||||
disabled: false,
|
||||
catalog: imageCatalog,
|
||||
profile: creativeProfile
|
||||
}
|
||||
})
|
||||
await flushPromises()
|
||||
const size = wrapper.findAllComponents(NSelect).find(select => select.props('value') === '2048*2048')!
|
||||
@@ -120,7 +130,7 @@ describe('统一的 Naive UI 表单校验', () => {
|
||||
await input('#image-prompt', '仅用于上一形态')
|
||||
document.querySelector<HTMLElement>('#confirm-image-cost')!.click()
|
||||
await flushPromises()
|
||||
expect(button('确认生成图片').disabled).toBe(false)
|
||||
expect(button('确认生成图片').disabled).toBe(true)
|
||||
await wrapper.setProps({ form: { ...formFixture(), id: 'other-form' } })
|
||||
await flushPromises()
|
||||
expect(document.querySelector<HTMLTextAreaElement>('#image-prompt')?.value).toBe('')
|
||||
|
||||
@@ -464,6 +464,7 @@ describe('管理后台组件边界', () => {
|
||||
projectId: 'navigation-test',
|
||||
script: { ready: true, reason: null },
|
||||
breakdown: { ready: true, reason: null },
|
||||
preparation: { ready: true, reason: null },
|
||||
visualStyle: { ready: true, reason: null },
|
||||
identity: { ready: true, reason: null },
|
||||
subjectAssets: { ready: true, reason: null },
|
||||
|
||||
Reference in new issue
Block a user