From e0f88b1e407af46b614f8e36f599c85b3cf0163b Mon Sep 17 00:00:00 2001 From: GouJ Date: Fri, 25 Sep 2026 00:35:01 +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/features/subject-images/prompts.test.ts | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/features/subject-images/prompts.test.ts b/tests/features/subject-images/prompts.test.ts index 510efdc..801073e 100644 --- a/tests/features/subject-images/prompts.test.ts +++ b/tests/features/subject-images/prompts.test.ts @@ -10,6 +10,22 @@ import { useSubjectImages } from '@/features/subject-images/useSubjectImages' import FormPromptDialog from '@/features/subject-images/components/FormPromptDialog.vue' import GenerateImageDialog from '@/features/subject-images/components/GenerateImageDialog.vue' +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 const projectId = 'capability-test' /** 从实际挂载的确认弹窗查找操作按钮。 */ @@ -162,7 +178,7 @@ describe('形态正式提示词与批量配置', () => { }) it('正式提示词确认必须勾选,未确认不发送事件', async () => { const form = formFixture() - wrapper = mount(FormPromptDialog, { attachTo: document.body, props: { open: true, disabled: false, form } }) + wrapper = mount(FormPromptDialog, { attachTo: document.body, props: { open: true, disabled: false, form, catalog: imageCatalog, profile: creativeProfile } }) await flushPromises() find('生成正式提示词').click() await flushPromises() @@ -178,7 +194,7 @@ describe('形态正式提示词与批量配置', () => { const form = formFixture() form.appearancePrompt = null form.generationPrompt = null - wrapper = mount(GenerateImageDialog, { attachTo: document.body, props: { open: true, disabled: false, form } }) + wrapper = mount(GenerateImageDialog, { attachTo: document.body, props: { open: true, disabled: false, form, catalog: imageCatalog, profile: creativeProfile } }) await flushPromises() document.querySelector('#confirm-image-cost')!.click() await flushPromises()