兼容历史 UI 规范的统一图标入口
Project CI / Repository checks (push) Successful in 59s
Project CI / Frontend tests (push) Successful in 3m36s
Project CI / Backend tests (push) Successful in 4m20s
Project CI / Native shell tests (push) Successful in 16m1s

将历史 spec.generate 的 ui 类型映射到 icon\n补充 GenerationInputs V2 恢复回归测试
This commit is contained in:
2026-08-08 22:25:28 +08:00
parent 0a6d550d73
commit 8d4d7ecc95
2 changed files with 37 additions and 5 deletions
@@ -1206,6 +1206,38 @@ describe('ImageCanvasGenerationDialogModel', () => {
});
});
it('maps legacy ui spec.generate inputs to the unified icon spec composer', () => {
expect(
createSameSourceGenerationDialogDraft({
sourceLayer: createLayer({
sourceType: 'generated',
assetKind: 'icon-spec',
generationInputs: {
version: 2,
action: 'spec.generate',
fields: [
{ id: 'specType', title: '规范类型', value: 'ui' },
{ id: 'playSetting', title: '玩法设定', value: '消除玩法' },
{ id: 'artStyle', title: '美术风格', value: '糖果玻璃' },
],
references: [],
},
}),
availableLayers: [],
canvasSize: { width: 960, height: 720 },
viewport: { x: 0, y: 0, scale: 1 },
mode: 'redraw',
}),
).toMatchObject({
mode: 'spec',
specType: 'icon',
specValues: {
playSetting: '消除玩法',
artStyle: '糖果玻璃',
},
});
});
it('restores the narrowly scoped legacy scene recipe into the scene composer', () => {
expect(
createSameSourceGenerationDialogDraft({
@@ -1001,11 +1001,11 @@ function createNormalizedGenerationDialogDraft({
'custom',
);
const specType: SpecGenerationType =
specTypeValue === 'character' ||
specTypeValue === 'ui' ||
specTypeValue === 'icon'
? specTypeValue
: 'custom';
specTypeValue === 'ui'
? 'icon'
: specTypeValue === 'character' || specTypeValue === 'icon'
? specTypeValue
: 'custom';
return placeDraftBesideSourceLayer(
{
...createSpecDialogDraft({ canvasSize, viewport, specType }),