From cebe6cbb8100c34d77aebb86d79eb8ef1c286a7b Mon Sep 17 00:00:00 2001 From: GouJ Date: Fri, 25 Sep 2026 00:34:55 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E8=A1=A5=E5=85=85=E5=BD=A2=E6=80=81?= =?UTF-8?q?=E7=94=9F=E5=9B=BE=E6=A8=A1=E5=9E=8B=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/components/ui/form.test.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/components/ui/form.test.ts b/tests/components/ui/form.test.ts index 26c8e11..fb965ee 100644 --- a/tests/components/ui/form.test.ts +++ b/tests/components/ui/form.test.ts @@ -10,6 +10,22 @@ import StyleImages from '@/features/visual-style/components/StyleImages.vue' import { formFixture } from '@/features/subject-images/testing/fixtures' import { requiredTextRule } from '@/lib/form-rules' +const imageCatalog = { + defaults: { imageProvider: 'qwen-image', videoProvider: 'seedance' }, + images: [{ + type: 'image' as const, provider: 'qwen-image', providerLabel: 'Qwen', model: 'qwen-image-3.0-pro', + modelLabel: 'Qwen Image', supported: true as const, enabled: true, isDefault: true, capabilities: {}, + generationOptions: [{ key: 'size', label: '图片尺寸', type: 'size' as const, required: true, + options: [{ label: '1:1 · 2048×2048', value: '2048*2048' }] }], + defaults: { size: '2048*2048' }, projectConstraints: [] + }], + videos: [] +} +const creativeProfile = { + projectId: 'gallery-test', aspectRatio: '1:1' as const, imageProvider: 'qwen-image', + imageModel: 'qwen-image-3.0-pro', imageOptions: { size: '2048*2048' }, + videoProvider: 'seedance', videoModel: 'seedance', videoOptions: {} +} let wrapper: VueWrapper | undefined afterEach(() => { wrapper?.unmount() @@ -74,7 +90,7 @@ describe('统一的 Naive UI 表单校验', () => { it('图片宽高错误显示在两侧字段,补全后同时消失,切换目标清除校验状态', async () => { wrapper = mount(GenerateImageDialog, { attachTo: document.body, - props: { open: true, form: formFixture(), disabled: false } + props: { open: true, form: formFixture(), disabled: false, catalog: imageCatalog, profile: creativeProfile } }) await flushPromises() await input('#image-width', '1024')