fix(design): surface incomplete creation plans
This commit is contained in:
@@ -192,6 +192,40 @@ describe('AI Design Canvas page', () => {
|
||||
expect(screen.queryByTestId('image-workspace-works-rail')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows an incomplete meaningful plan and does not invent a selected aspect ratio', async () => {
|
||||
const form = designFormFixture();
|
||||
form.specification.values.content.concept = null;
|
||||
form.specification.values.content.action = '一只狗和一只猫在草地上互相扑咬玩闹';
|
||||
form.specification.values.output.aspect_ratio = null;
|
||||
form.specification.values.output.orientation = 'portrait';
|
||||
const { actions } = prepareWorkspace({ form });
|
||||
useImageWorkspaceStore.setState({
|
||||
quoteBlockers: [{
|
||||
code: 'aspect_ratio_required',
|
||||
message: 'Choose an aspect ratio before requesting a production quote.',
|
||||
severity: 'blocker',
|
||||
path: 'output.aspect_ratio',
|
||||
}],
|
||||
});
|
||||
|
||||
render(<ImageCanvas />);
|
||||
|
||||
expect(screen.getByRole('heading', { name: '制作方案' })).toBeInTheDocument();
|
||||
expect(screen.getByText('先选择作品形状。')).toBeInTheDocument();
|
||||
expect(screen.getByRole('combobox', { name: '画幅' })).toHaveValue('');
|
||||
expect(screen.getByRole('button', { name: '准备制作方案' })).toBeDisabled();
|
||||
|
||||
fireEvent.change(screen.getByRole('combobox', { name: '画幅' }), {
|
||||
target: { value: '9:16' },
|
||||
});
|
||||
await waitFor(() => {
|
||||
expect(actions.applyFieldOperations).toHaveBeenCalledWith([
|
||||
{ kind: 'set', path: 'output.aspect_ratio', value: '9:16' },
|
||||
{ kind: 'set', path: 'output.orientation', value: 'portrait' },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
it('opens project navigation as a left sheet on compact layouts', () => {
|
||||
prepareWorkspace();
|
||||
render(<ImageCanvas />);
|
||||
|
||||
Reference in New Issue
Block a user