fix(canvas): use server video duration options
This commit is contained in:
@@ -510,7 +510,7 @@ describe('ImageCanvas Workspace-first design experience', () => {
|
||||
expect(screen.getByRole('button', { name: '确认并开始生成' })).toBeEnabled();
|
||||
});
|
||||
|
||||
it('limits legacy video durations to 2-6 seconds and preserves 6 seconds through confirmation', async () => {
|
||||
it('uses server-provided video durations and preserves the selected value through confirmation', async () => {
|
||||
const videoConversation = conversationFixture();
|
||||
const videoQuote = videoConversation.messages[1].generationQuote!;
|
||||
videoConversation.brief.medium = 'video';
|
||||
@@ -543,7 +543,7 @@ describe('ImageCanvas Workspace-first design experience', () => {
|
||||
const durationSelect = await screen.findByTestId('design-quote-duration');
|
||||
expect(durationSelect).toHaveValue('');
|
||||
expect(within(durationSelect).getAllByRole('option').map((option) => option.getAttribute('value')))
|
||||
.toEqual(['', '2', '6']);
|
||||
.toEqual(['', '2', '6', '7', '15']);
|
||||
expect(screen.getByRole('button', { name: '确认并开始生成' })).toBeDisabled();
|
||||
|
||||
fireEvent.change(screen.getByLabelText('设计需求'), {
|
||||
@@ -552,9 +552,9 @@ describe('ImageCanvas Workspace-first design experience', () => {
|
||||
fireEvent.click(screen.getByRole('button', { name: '发送给设计 Agent' }));
|
||||
|
||||
expect(confirmImageWorkspaceGenerationMock).not.toHaveBeenCalled();
|
||||
expect(await screen.findByRole('alert')).toHaveTextContent('请选择 2 至 6 秒的视频时长');
|
||||
expect(await screen.findByRole('alert')).toHaveTextContent('请选择服务端提供的视频时长');
|
||||
|
||||
fireEvent.change(durationSelect, { target: { value: '6' } });
|
||||
fireEvent.change(durationSelect, { target: { value: '15' } });
|
||||
|
||||
await waitFor(() => expect(updateImageWorkspaceGenerationQuoteMock).toHaveBeenCalledWith(
|
||||
'workspace-cloud',
|
||||
@@ -562,10 +562,10 @@ describe('ImageCanvas Workspace-first design experience', () => {
|
||||
videoQuote.finalPrompt,
|
||||
{
|
||||
...videoQuote.generationParameters,
|
||||
durationSeconds: 6,
|
||||
durationSeconds: 15,
|
||||
},
|
||||
));
|
||||
await waitFor(() => expect(screen.getByTestId('design-quote-duration')).toHaveValue('6'));
|
||||
await waitFor(() => expect(screen.getByTestId('design-quote-duration')).toHaveValue('15'));
|
||||
fireEvent.click(screen.getByRole('button', { name: '确认并开始生成' }));
|
||||
|
||||
await waitFor(() => expect(confirmImageWorkspaceGenerationMock).toHaveBeenCalledWith(
|
||||
@@ -577,7 +577,7 @@ describe('ImageCanvas Workspace-first design experience', () => {
|
||||
videoQuote.finalPrompt,
|
||||
{
|
||||
...videoQuote.generationParameters,
|
||||
durationSeconds: 6,
|
||||
durationSeconds: 15,
|
||||
},
|
||||
));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user