fix(canvas): block invalid video duration confirmation

This commit is contained in:
2026-08-18 11:32:38 +08:00
parent 566f99f5ed
commit 11b19832a3
3 changed files with 39 additions and 1 deletions

View File

@@ -544,6 +544,15 @@ describe('ImageCanvas Workspace-first design experience', () => {
expect(durationSelect).toHaveValue('');
expect(within(durationSelect).getAllByRole('option').map((option) => option.getAttribute('value')))
.toEqual(['', '2', '6']);
expect(screen.getByRole('button', { name: '确认并开始生成' })).toBeDisabled();
fireEvent.change(screen.getByLabelText('设计需求'), {
target: { value: '确认生成' },
});
fireEvent.click(screen.getByRole('button', { name: '发送给设计 Agent' }));
expect(confirmImageWorkspaceGenerationMock).not.toHaveBeenCalled();
expect(await screen.findByRole('alert')).toHaveTextContent('请选择 2 至 6 秒的视频时长');
fireEvent.change(durationSelect, { target: { value: '6' } });