fix(design): distinguish saved video settings from preparation needs
This commit is contained in:
@@ -123,7 +123,7 @@ test.describe('AI Design V2 workspace', () => {
|
||||
preserve_instructions: [],
|
||||
change_instructions: [],
|
||||
},
|
||||
video: { shots: [] },
|
||||
video: { shots: [], total_duration_seconds: null as number | null },
|
||||
output: {
|
||||
aspect_ratio: '3:4',
|
||||
orientation: 'portrait',
|
||||
@@ -186,11 +186,19 @@ test.describe('AI Design V2 workspace', () => {
|
||||
__designE2eAuthReady?: boolean;
|
||||
__designE2eProfileReady?: boolean;
|
||||
__designE2eCompleteTask?: () => void;
|
||||
__designE2eOpenIncompleteVideo?: () => void;
|
||||
__designE2eDownloadCount?: number;
|
||||
};
|
||||
e2eGlobal.__designE2eAuthReady = false;
|
||||
e2eGlobal.__designE2eProfileReady = false;
|
||||
e2eGlobal.__designE2eDownloadCount = 0;
|
||||
e2eGlobal.__designE2eOpenIncompleteVideo = () => {
|
||||
workspace.form.specification.values.intent.media = 'video';
|
||||
workspace.form.specification.values.video.total_duration_seconds = null;
|
||||
workspace.form.directionRevision += 1;
|
||||
workspace.form.specificationRevision += 1;
|
||||
workspace.workspace.specificationRevision = workspace.form.specificationRevision;
|
||||
};
|
||||
e2eGlobal.__designE2eCompleteTask = () => {
|
||||
workspace.tasks[0] = {
|
||||
...workspace.tasks[0],
|
||||
@@ -303,6 +311,9 @@ test.describe('AI Design V2 workspace', () => {
|
||||
if (operation.kind === 'set' && operation.path === 'output.orientation') {
|
||||
workspace.form.specification.values.output.orientation = String(operation.value ?? '');
|
||||
}
|
||||
if (operation.kind === 'set' && operation.path === 'video.total_duration_seconds') {
|
||||
workspace.form.specification.values.video.total_duration_seconds = Number(operation.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (command.input?.kind === 'chat' && command.input.message) {
|
||||
@@ -589,6 +600,20 @@ test.describe('AI Design V2 workspace', () => {
|
||||
expect(await app.evaluate(() => (
|
||||
globalThis as typeof globalThis & { __designE2eDownloadCount?: number }
|
||||
).__designE2eDownloadCount)).toBe(0);
|
||||
await app.evaluate(() => {
|
||||
(globalThis as typeof globalThis & { __designE2eOpenIncompleteVideo?: () => void })
|
||||
.__designE2eOpenIncompleteVideo?.();
|
||||
});
|
||||
await page.reload();
|
||||
const duration = page.getByRole('combobox', { name: '时长' });
|
||||
await expect(duration).toHaveValue('');
|
||||
await expect(page.getByRole('button', { name: '增加时长' })).toHaveCount(0);
|
||||
await expect(page.getByText('至少写一个视频画面。')).toHaveCount(0);
|
||||
await duration.selectOption('6');
|
||||
await expect(page.getByRole('button', { name: '增加时长' })).toBeEnabled();
|
||||
await page.reload();
|
||||
await expect(page.getByRole('combobox', { name: '时长' })).toHaveCount(0);
|
||||
await expect(page.getByText('6 秒', { exact: true })).toBeVisible();
|
||||
} finally {
|
||||
await closeElectronApp(app);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user