补齐 GPT Image 2.5 前端回归测试
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 6m51s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 6m53s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 6m28s
Project CI / Backend tests (pull_request) Failing after 13s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 6m49s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m0s
Project CI / Repository checks (pull_request) Failing after 9s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m56s
Project CI / AI game creator shell web tests (pull_request) Failing after 4m52s
Project CI / Frontend tests (pull_request) Failing after 14m17s
Project CI / Native shell tests (pull_request) Successful in 16m11s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 6m51s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 6m53s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 6m28s
Project CI / Backend tests (pull_request) Failing after 13s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 6m49s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m0s
Project CI / Repository checks (pull_request) Failing after 9s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m56s
Project CI / AI game creator shell web tests (pull_request) Failing after 4m52s
Project CI / Frontend tests (pull_request) Failing after 14m17s
Project CI / Native shell tests (pull_request) Successful in 16m11s
更新模型标签、提交 payload 与固定模型断言 覆盖 gpt-image-2-c 历史恢复及参数回退告警 保留历史 fixture 原值并验证 nanobanana 默认不变
This commit is contained in:
@@ -232,10 +232,10 @@ describe('ImageCanvasBasicGenerationComposerView', () => {
|
||||
);
|
||||
const modelPanel = screen.getByRole('menu', { name: '生成图片模型选项' });
|
||||
fireEvent.click(
|
||||
within(modelPanel).getByRole('button', { name: /gpt-image-2/ }),
|
||||
within(modelPanel).getByRole('button', { name: /GPT Image 2\.5/ }),
|
||||
);
|
||||
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2');
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2.5');
|
||||
const submitButton = within(panel).getByRole('button', { name: '生成' });
|
||||
expect(submitButton.textContent).toBe('生成5泥点');
|
||||
});
|
||||
@@ -284,7 +284,7 @@ describe('ImageCanvasBasicGenerationComposerView', () => {
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
within(panel).getByRole('button', {
|
||||
name: '快速编辑图片模型 gpt-image-2',
|
||||
name: '快速编辑图片模型 GPT Image 2.5',
|
||||
}),
|
||||
).toBeTruthy();
|
||||
expect(within(panel).getByRole('button', { name: '修改' })).toBeTruthy();
|
||||
|
||||
@@ -14,7 +14,7 @@ import type {
|
||||
SpecGenerationType,
|
||||
UploadTarget,
|
||||
} from './ImageCanvasEditorTypes';
|
||||
import { IMAGE_MODEL_GPT_IMAGE_2 } from './ImageCanvasGenerationModel';
|
||||
import { IMAGE_MODEL_GPT_IMAGE_2_5 } from './ImageCanvasGenerationModel';
|
||||
|
||||
function createDialog(
|
||||
patch: Partial<GenerateDialogState> = {},
|
||||
@@ -165,9 +165,9 @@ describe('ImageCanvasCharacterGenerationComposerView', () => {
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: '生成图片模型 nanobanana2' }),
|
||||
);
|
||||
fireEvent.click(screen.getByRole('button', { name: 'gpt-image-2' }));
|
||||
fireEvent.click(screen.getByRole('button', { name: 'GPT Image 2.5' }));
|
||||
|
||||
expect(rememberImageModel).toHaveBeenCalledWith(IMAGE_MODEL_GPT_IMAGE_2);
|
||||
expect(rememberImageModel).toHaveBeenCalledWith(IMAGE_MODEL_GPT_IMAGE_2_5);
|
||||
expect(screen.getByRole('button', { name: '生成' }).textContent).toBe(
|
||||
'生成3泥点',
|
||||
);
|
||||
|
||||
@@ -1807,7 +1807,7 @@ describe('ImageCanvasEditorView generation integration', () => {
|
||||
const characterPanel = screen.getByRole('dialog', {
|
||||
name: '生成角色形象',
|
||||
});
|
||||
selectGenerationModel(characterPanel, 'gpt-image-2');
|
||||
selectGenerationModel(characterPanel, 'GPT Image 2.5');
|
||||
selectGenerationDimensions(characterPanel, '2:3', '2K');
|
||||
setPlainTextEditorValue(
|
||||
within(characterPanel).getByLabelText('角色设定'),
|
||||
@@ -1822,7 +1822,7 @@ describe('ImageCanvasEditorView generation integration', () => {
|
||||
expect.objectContaining({
|
||||
kind: 'character',
|
||||
prompt: '蓝衣剑士',
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
aspectRatio: '2:3',
|
||||
imageSize: '2K',
|
||||
}),
|
||||
@@ -1838,7 +1838,7 @@ describe('ImageCanvasEditorView generation integration', () => {
|
||||
const iconPanel = screen.getByRole('dialog', { name: '生成图标素材' });
|
||||
expect(
|
||||
within(iconPanel).getByRole('button', {
|
||||
name: '生成图片模型 gpt-image-2',
|
||||
name: '生成图片模型 GPT Image 2.5',
|
||||
}),
|
||||
).toBeTruthy();
|
||||
fireEvent.click(
|
||||
|
||||
@@ -445,7 +445,7 @@ describe('ImageCanvasGenerationComposerView', () => {
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
within(panel).getByRole('button', {
|
||||
name: '快速编辑图片模型 gpt-image-2',
|
||||
name: '快速编辑图片模型 GPT Image 2.5',
|
||||
}),
|
||||
).toBeTruthy();
|
||||
expect(within(panel).getByRole('button', { name: '修改' })).toBeTruthy();
|
||||
|
||||
@@ -40,6 +40,7 @@ import {
|
||||
} from './ImageCanvasGenerationDialogModel';
|
||||
import {
|
||||
IMAGE_MODEL_GPT_IMAGE_2,
|
||||
IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
IMAGE_MODEL_NANOBANANA2,
|
||||
} from './ImageCanvasGenerationModel';
|
||||
|
||||
@@ -187,7 +188,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
).toMatchObject({
|
||||
mode: 'character',
|
||||
style: 'none',
|
||||
imageModel: 'gpt-image-2',
|
||||
imageModel: 'gpt-image-2.5',
|
||||
aspectRatio: '1:1',
|
||||
imageSize: '1K',
|
||||
characterSpecReference: null,
|
||||
@@ -260,7 +261,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
}),
|
||||
).toMatchObject({
|
||||
mode: 'ui-design',
|
||||
imageModel: 'gpt-image-2',
|
||||
imageModel: 'gpt-image-2.5',
|
||||
aspectRatio: '16:9',
|
||||
imageSize: '1K',
|
||||
uiDesignSpecReference: null,
|
||||
@@ -465,7 +466,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
status: 'idle',
|
||||
composerOpen: true,
|
||||
sourceLayerId: 'layer-source',
|
||||
imageModel: 'gpt-image-2',
|
||||
imageModel: 'gpt-image-2.5',
|
||||
aspectRatio: '4:3',
|
||||
imageSize: '1K',
|
||||
});
|
||||
@@ -475,7 +476,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
size: '1024x768',
|
||||
aspectRatio: '4:3',
|
||||
imageSize: '1K',
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
quickEditReferences: [],
|
||||
status: 'idle',
|
||||
});
|
||||
@@ -516,7 +517,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
|
||||
expect(createEditDialogDraft(sourceLayer)).toMatchObject({
|
||||
prompt: '改成雨天',
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '2:3',
|
||||
imageSize: '2K',
|
||||
});
|
||||
@@ -737,7 +738,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
mode: 'generate',
|
||||
prompt: '普通图',
|
||||
sourceLayerId: 'layer-source',
|
||||
imageModel: 'gpt-image-2',
|
||||
imageModel: 'gpt-image-2.5',
|
||||
aspectRatio: '2:3',
|
||||
imageSize: '2K',
|
||||
style: 'none',
|
||||
@@ -778,7 +779,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
}),
|
||||
).toMatchObject({
|
||||
mode,
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '2:3',
|
||||
imageSize: '2K',
|
||||
placeholder: {
|
||||
@@ -815,7 +816,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
mode: 'generate',
|
||||
prompt: '元数据提示词',
|
||||
generatedLayerId: 'layer-source',
|
||||
imageModel: 'gpt-image-2',
|
||||
imageModel: 'gpt-image-2.5',
|
||||
placeholder: {
|
||||
x: 120,
|
||||
y: 140,
|
||||
@@ -1149,7 +1150,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
).toMatchObject({
|
||||
mode: 'generate',
|
||||
prompt: '',
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '2:3',
|
||||
imageSize: '2K',
|
||||
});
|
||||
@@ -1204,7 +1205,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
prompt: '雨夜海边车站',
|
||||
sceneStylePreset: 'custom',
|
||||
sceneCustomStyle: '复古像素风',
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '16:9',
|
||||
imageSize: '2K',
|
||||
generationReferences: [
|
||||
@@ -1273,7 +1274,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
mode: 'scene',
|
||||
prompt: '雨夜海边车站',
|
||||
sceneStylePreset: 'watercolor',
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '16:9',
|
||||
imageSize: '2K',
|
||||
});
|
||||
@@ -1394,7 +1395,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
imageSize: '2K',
|
||||
}),
|
||||
).toMatchObject({
|
||||
model: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
model: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '16:9',
|
||||
imageSize: '2K',
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ImageCanvasGenerationImageOptionsView } from './ImageCanvasGenerationIm
|
||||
import {
|
||||
calculateEditorImageGenerationPrice,
|
||||
IMAGE_MODEL_GPT_IMAGE_2,
|
||||
IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
IMAGE_MODEL_NANOBANANA2,
|
||||
} from './ImageCanvasGenerationModel';
|
||||
|
||||
@@ -226,17 +227,19 @@ describe('ImageCanvasGenerationImageOptionsView', () => {
|
||||
expect(
|
||||
within(panel).getByRole('button', { name: 'nanobanana2' }),
|
||||
).toBeTruthy();
|
||||
fireEvent.click(within(panel).getByRole('button', { name: 'gpt-image-2' }));
|
||||
fireEvent.click(
|
||||
within(panel).getByRole('button', { name: 'GPT Image 2.5' }),
|
||||
);
|
||||
|
||||
expect(screen.getByRole('menu', { name: '生成图片模型选项' })).toBeTruthy();
|
||||
expect(rememberImageModel).toHaveBeenCalledWith(IMAGE_MODEL_GPT_IMAGE_2);
|
||||
expect(rememberImageModel).toHaveBeenCalledWith(IMAGE_MODEL_GPT_IMAGE_2_5);
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe(
|
||||
IMAGE_MODEL_GPT_IMAGE_2,
|
||||
IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
);
|
||||
expect(screen.getByLabelText('当前比例').textContent).toBe('9:16');
|
||||
expect(screen.getByLabelText('当前尺寸').textContent).toBe('1K');
|
||||
expect(
|
||||
screen.getByRole('button', { name: '生成图片模型 gpt-image-2' }),
|
||||
screen.getByRole('button', { name: '生成图片模型 GPT Image 2.5' }),
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
screen.getByRole('button', { name: '生成角色形象' }).textContent,
|
||||
@@ -261,7 +264,7 @@ describe('ImageCanvasGenerationImageOptionsView', () => {
|
||||
);
|
||||
|
||||
const modelButton = screen.getByRole('button', {
|
||||
name: '生成图片模型 gpt-image-2',
|
||||
name: '生成图片模型 GPT Image 2.5',
|
||||
}) as HTMLButtonElement;
|
||||
|
||||
expect(modelButton.disabled).toBe(true);
|
||||
@@ -302,12 +305,12 @@ describe('ImageCanvasGenerationImageOptionsView', () => {
|
||||
fireEvent.click(
|
||||
within(screen.getByRole('menu', { name: '生成图片模型选项' })).getByRole(
|
||||
'button',
|
||||
{ name: 'gpt-image-2' },
|
||||
{ name: 'GPT Image 2.5' },
|
||||
),
|
||||
);
|
||||
|
||||
expect(alertMock).toHaveBeenCalledWith(
|
||||
'当前已有 8 张参考图,gpt-image-2 最多允许 4 张,请先删除多余参考图后再切换',
|
||||
'当前已有 8 张参考图,GPT Image 2.5 最多允许 4 张,请先删除多余参考图后再切换',
|
||||
);
|
||||
expect(screen.getByLabelText('当前参考图数量').textContent).toBe('8');
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe(
|
||||
@@ -338,7 +341,7 @@ describe('ImageCanvasGenerationImageOptionsView', () => {
|
||||
fireEvent.click(
|
||||
within(screen.getByRole('menu', { name: '生成图片模型选项' })).getByRole(
|
||||
'button',
|
||||
{ name: 'gpt-image-2' },
|
||||
{ name: 'GPT Image 2.5' },
|
||||
),
|
||||
);
|
||||
|
||||
@@ -412,12 +415,12 @@ describe('ImageCanvasGenerationImageOptionsView', () => {
|
||||
fireEvent.click(
|
||||
within(screen.getByRole('menu', { name: '生成图片模型选项' })).getByRole(
|
||||
'button',
|
||||
{ name: 'gpt-image-2' },
|
||||
{ name: 'GPT Image 2.5' },
|
||||
),
|
||||
);
|
||||
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe(
|
||||
IMAGE_MODEL_GPT_IMAGE_2,
|
||||
IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
);
|
||||
expect(screen.getByLabelText('当前比例').textContent).toBe('4:3');
|
||||
expect(screen.getByLabelText('当前尺寸').textContent).toBe('1K');
|
||||
|
||||
@@ -48,6 +48,8 @@ import {
|
||||
getGenerationFrameAriaLabel,
|
||||
getGenerationFrameLabel,
|
||||
IMAGE_MODEL_GPT_IMAGE_2,
|
||||
IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
IMAGE_MODEL_GPT_IMAGE_2_C,
|
||||
IMAGE_MODEL_NANOBANANA2,
|
||||
isNormalizedCanvasGenerationInputs,
|
||||
isQuickEditSupportedLayer,
|
||||
@@ -237,7 +239,7 @@ describe('ImageCanvasGenerationModel', () => {
|
||||
applyEditorGenerationPricingConfig({
|
||||
models: {
|
||||
...EDITOR_MODEL_MUD_POINT_CONFIG,
|
||||
[IMAGE_MODEL_GPT_IMAGE_2]: {
|
||||
[IMAGE_MODEL_GPT_IMAGE_2_5]: {
|
||||
unit: 'perGeneration',
|
||||
prices: {
|
||||
'1K': 29,
|
||||
@@ -690,7 +692,17 @@ describe('ImageCanvasGenerationModel', () => {
|
||||
imageSize: '2K',
|
||||
}),
|
||||
);
|
||||
expect(valid).toMatchObject({ ok: true, warnings: [] });
|
||||
expect(valid).toMatchObject({
|
||||
ok: true,
|
||||
inputs: {
|
||||
fields: expect.arrayContaining([
|
||||
{ id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2_5 },
|
||||
]),
|
||||
},
|
||||
warnings: expect.arrayContaining([
|
||||
expect.objectContaining({ fieldIds: ['model'] }),
|
||||
]),
|
||||
});
|
||||
|
||||
const alias = decodeCanvasGenerationInputs({
|
||||
version: 2,
|
||||
@@ -714,6 +726,32 @@ describe('ImageCanvasGenerationModel', () => {
|
||||
).toBe(IMAGE_MODEL_NANOBANANA2);
|
||||
});
|
||||
|
||||
it('restores the concrete legacy GPT image value to GPT Image 2.5 with a warning', () => {
|
||||
const decoded = decodeCanvasGenerationInputs({
|
||||
version: 2,
|
||||
action: 'image.generate',
|
||||
fields: [
|
||||
{ id: 'prompt', title: '生成提示词', value: '旧模型素材' },
|
||||
{ id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2_C },
|
||||
{ id: 'aspectRatio', title: '比例', value: '1:1' },
|
||||
{ id: 'imageSize', title: '尺寸', value: '1K' },
|
||||
],
|
||||
references: [],
|
||||
});
|
||||
|
||||
expect(decoded).toMatchObject({
|
||||
ok: true,
|
||||
inputs: {
|
||||
fields: expect.arrayContaining([
|
||||
{ id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2_5 },
|
||||
]),
|
||||
},
|
||||
warnings: expect.arrayContaining([
|
||||
expect.objectContaining({ fieldIds: ['model'] }),
|
||||
]),
|
||||
});
|
||||
});
|
||||
|
||||
it('falls invalid image and workflow parameters back within V2', () => {
|
||||
const image = decodeCanvasGenerationInputs({
|
||||
version: 2,
|
||||
@@ -932,14 +970,14 @@ describe('ImageCanvasGenerationModel', () => {
|
||||
label: 'nanobanana2',
|
||||
value: 'gemini-3.1-flash-image-preview',
|
||||
},
|
||||
{ label: 'gpt-image-2', value: 'gpt-image-2' },
|
||||
{ label: 'GPT Image 2.5', value: 'gpt-image-2.5' },
|
||||
]);
|
||||
expect(buildQuickEditModelOptions('nanobanana2')).toEqual([
|
||||
{
|
||||
label: 'nanobanana2',
|
||||
value: 'gemini-3.1-flash-image-preview',
|
||||
},
|
||||
{ label: 'gpt-image-2', value: 'gpt-image-2' },
|
||||
{ label: 'GPT Image 2.5', value: 'gpt-image-2.5' },
|
||||
]);
|
||||
expect(
|
||||
isQuickEditSupportedLayer({
|
||||
|
||||
@@ -4,6 +4,7 @@ import { EDITOR_ICON_DESCRIPTION_MAX_CHARS } from '../../services/image-editor/e
|
||||
import type { CanvasLayer } from './ImageCanvasEditorTypes';
|
||||
import {
|
||||
IMAGE_MODEL_GPT_IMAGE_2,
|
||||
IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
IMAGE_MODEL_NANOBANANA2,
|
||||
} from './ImageCanvasGenerationModel';
|
||||
import {
|
||||
@@ -333,14 +334,14 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
expect(plan).toMatchObject({
|
||||
kind: 'edit',
|
||||
editInput: {
|
||||
model: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
model: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '2:3',
|
||||
imageSize: '2K',
|
||||
size: '1365x2048',
|
||||
},
|
||||
generationInputs: expect.objectContaining({
|
||||
fields: expect.arrayContaining([
|
||||
{ id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2 },
|
||||
{ id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2_5 },
|
||||
{ id: 'aspectRatio', title: '比例', value: '2:3' },
|
||||
{ id: 'imageSize', title: '尺寸', value: '2K' },
|
||||
]),
|
||||
@@ -384,7 +385,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
sourceLayer,
|
||||
editInput: {
|
||||
size: '1024x768',
|
||||
model: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
model: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '4:3',
|
||||
imageSize: '1K',
|
||||
referenceImageSrcs: ['data:image/png;base64,style'],
|
||||
@@ -420,7 +421,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
],
|
||||
}),
|
||||
},
|
||||
rememberImageModel: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
rememberImageModel: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -650,7 +651,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
input: {
|
||||
prompt: '白发骑士',
|
||||
kind: 'character',
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
screenColor: 'auto',
|
||||
segModel: 'birefnet',
|
||||
style: 'pixelArt',
|
||||
@@ -665,7 +666,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
assetKind: 'character',
|
||||
title: '角色形象 9',
|
||||
},
|
||||
rememberImageModel: 'gpt-image-2',
|
||||
rememberImageModel: 'gpt-image-2.5',
|
||||
});
|
||||
expect(plan.kind === 'image' ? plan.result.generationInputs : null).toEqual(
|
||||
expect.objectContaining({
|
||||
@@ -727,7 +728,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
normalizedPrompt: '设计移动端商城首页',
|
||||
input: {
|
||||
kind: 'ui-design',
|
||||
model: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
model: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
aspectRatio: '16:9',
|
||||
imageSize: '1K',
|
||||
referenceImageSrcs: [
|
||||
@@ -762,7 +763,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
],
|
||||
}),
|
||||
},
|
||||
rememberImageModel: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
rememberImageModel: IMAGE_MODEL_GPT_IMAGE_2_5,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -802,7 +803,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
prompt: expect.stringContaining('【宣发素材类型】游戏首图'),
|
||||
size: '720x540',
|
||||
kind: 'publication-material',
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
aspectRatio: '4:3',
|
||||
imageSize: '1K',
|
||||
referenceImageSrcs: ['data:image/png;base64,ref'],
|
||||
@@ -950,7 +951,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
expect(plan.input).toEqual(
|
||||
expect.objectContaining({
|
||||
kind: 'publication-material',
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
size: '1280x720',
|
||||
aspectRatio: '16:9',
|
||||
imageSize: '1K',
|
||||
@@ -1080,7 +1081,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
referenceId: 'resource-icon-spec',
|
||||
referenceImageSrcs: ['data:image/png;base64,ref'],
|
||||
iconDescriptions: ['返回按钮\n\n设置按钮'],
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
screenColor: 'auto',
|
||||
segModel: 'birefnet',
|
||||
style: 'pixelArt',
|
||||
@@ -1110,7 +1111,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
},
|
||||
],
|
||||
}),
|
||||
rememberImageModel: 'gpt-image-2',
|
||||
rememberImageModel: 'gpt-image-2.5',
|
||||
resultTitle: '冒险游戏图标',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -249,11 +249,11 @@ describe('ImageCanvasIconSpritesheetComposerView', () => {
|
||||
);
|
||||
const modelPanel = screen.getByRole('menu', { name: '生成图片模型选项' });
|
||||
fireEvent.click(
|
||||
within(modelPanel).getByRole('button', { name: 'gpt-image-2' }),
|
||||
within(modelPanel).getByRole('button', { name: 'GPT Image 2.5' }),
|
||||
);
|
||||
|
||||
expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2');
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2');
|
||||
expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2.5');
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2.5');
|
||||
expect(screen.getByLabelText('当前尺寸').textContent).toBe('1K');
|
||||
expect(screen.getByRole('button', { name: '生成' }).textContent).toBe(
|
||||
'生成3泥点',
|
||||
|
||||
@@ -49,14 +49,14 @@ function PublicationPanelHarness({
|
||||
}
|
||||
|
||||
describe('ImageCanvasPublicationMaterialsDemoPanelView', () => {
|
||||
it('locks publication material model selection to gpt-image-2', () => {
|
||||
it('locks publication material model selection to GPT Image 2.5', () => {
|
||||
const rememberImageModel = vi.fn();
|
||||
render(
|
||||
<PublicationPanelHarness onRememberImageModel={rememberImageModel} />,
|
||||
);
|
||||
|
||||
const modelButton = screen.getByRole('button', {
|
||||
name: '宣发素材模型 gpt-image-2',
|
||||
name: '宣发素材模型 GPT Image 2.5',
|
||||
}) as HTMLButtonElement;
|
||||
const description = screen.getByRole('textbox', {
|
||||
name: '游戏首图一句话描述游戏',
|
||||
|
||||
@@ -107,9 +107,9 @@ describe('ImageCanvasQuickEditPanelView', () => {
|
||||
screen.getByRole('button', { name: '快速编辑模型 nanobanana2' }),
|
||||
);
|
||||
expect(screen.getByRole('button', { name: 'nanobanana2' })).toBeTruthy();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'gpt-image-2' }));
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2');
|
||||
expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2');
|
||||
fireEvent.click(screen.getByRole('button', { name: 'GPT Image 2.5' }));
|
||||
expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2.5');
|
||||
expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2.5');
|
||||
});
|
||||
|
||||
it('renders the failure message inside the quick edit alert', () => {
|
||||
|
||||
@@ -197,7 +197,7 @@ describe('ImageCanvasSpecGenerationPanelView', () => {
|
||||
name: '生成图片尺寸 16:9·2K',
|
||||
}) as HTMLButtonElement;
|
||||
const modelButton = screen.getByRole('button', {
|
||||
name: '生成图片模型 gpt-image-2',
|
||||
name: '生成图片模型 GPT Image 2.5',
|
||||
}) as HTMLButtonElement;
|
||||
|
||||
expect(dimensionsButton.disabled).toBe(true);
|
||||
@@ -256,7 +256,7 @@ describe('ImageCanvasSpecGenerationPanelView', () => {
|
||||
);
|
||||
const submitButton = screen.getByRole('button', { name: '生成UI设计图' });
|
||||
const modelButton = screen.getByRole('button', {
|
||||
name: '生成图片模型 gpt-image-2',
|
||||
name: '生成图片模型 GPT Image 2.5',
|
||||
}) as HTMLButtonElement;
|
||||
|
||||
expect(submitButton.textContent).toBe('生成3泥点');
|
||||
|
||||
@@ -1178,7 +1178,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
|
||||
prompt: '把当前图改成雨天',
|
||||
sourceReferenceId: 'resource-source',
|
||||
size: '1024x768',
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
targetLayerId: 'layer-source',
|
||||
assetLabel: '源图 快速编辑',
|
||||
}),
|
||||
@@ -1461,7 +1461,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
|
||||
referenceImageSrcs: [
|
||||
'generated-character-drafts/editor/generation-references/reference.png',
|
||||
],
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
targetLayerId: 'layer-source',
|
||||
}),
|
||||
);
|
||||
@@ -3803,7 +3803,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
|
||||
size: '720x1280',
|
||||
kind: 'publication-material',
|
||||
assetKind: 'publication-material',
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
aspectRatio: '9:16',
|
||||
imageSize: '1K',
|
||||
referenceImageSrcs: [
|
||||
@@ -4102,7 +4102,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
|
||||
expect.objectContaining({
|
||||
referenceId: 'resource-icon-spec',
|
||||
iconDescriptions: ['返回按钮\n设置按钮'],
|
||||
model: 'gpt-image-2',
|
||||
model: 'gpt-image-2.5',
|
||||
assetLabel: '复古操作图标',
|
||||
canvasCompletion: expect.objectContaining({
|
||||
title: '复古操作图标',
|
||||
@@ -4125,7 +4125,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
|
||||
'icon:idle:open:layer-icon-spritesheet-1:placeholder:-',
|
||||
);
|
||||
expect(screen.getByTestId('remembered-model').textContent).toBe(
|
||||
'gpt-image-2',
|
||||
'gpt-image-2.5',
|
||||
);
|
||||
expect(screen.getByTestId('generation-warning').textContent).toBe(
|
||||
'图集已生成,但自动拆分未完成:连通域数量不足',
|
||||
|
||||
Reference in New Issue
Block a user