修复图集快速编辑后端校验与错误提示
后端允许完整图标图集进入图片快速编辑,仅继续禁止单个图标。 快速编辑失败时向红色错误框传递具体错误文案。 补充前后端回归测试并同步画布编辑器技术文档。
This commit is contained in:
@@ -124,6 +124,27 @@ describe('ImageCanvasQuickEditPanelView', () => {
|
||||
expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2');
|
||||
});
|
||||
|
||||
it('renders the failure message inside the quick edit alert', () => {
|
||||
render(
|
||||
<QuickEditPanelHarness
|
||||
initialPanel={{
|
||||
sourceLayerId: 'layer-a',
|
||||
prompt: '调整图集布局',
|
||||
size: '1024x1024',
|
||||
aspectRatio: '1:1',
|
||||
imageSize: '1K',
|
||||
model: 'gpt-image-2',
|
||||
status: 'failed',
|
||||
errorMessage: '图集快速编辑失败',
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByRole('alert').textContent).toContain(
|
||||
'图集快速编辑失败',
|
||||
);
|
||||
});
|
||||
|
||||
it('submits without rendering a standalone close button', () => {
|
||||
const submitQuickEdit = vi.fn();
|
||||
render(
|
||||
|
||||
@@ -53,6 +53,7 @@ function createQuickEditDialog(
|
||||
mode: isQuickEdit ? 'quick-edit' : 'generate',
|
||||
prompt: panel.prompt,
|
||||
status: panel.status,
|
||||
errorMessage: panel.errorMessage,
|
||||
sourceLayerId: panel.sourceLayerId,
|
||||
generationReferences: panel.quickEditReferences,
|
||||
assetLabel: panel.assetLabel,
|
||||
|
||||
Reference in New Issue
Block a user