Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/video-editor/EditorEmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export function EditorEmptyState({ onVideoImported, onProjectOpened }: EditorEmp
<div className="flex flex-col gap-3 w-full max-w-xs">
<button
type="button"
data-testid="editor-empty-import-video-button"
onClick={handleImportVideo}
className="flex items-center justify-center gap-2.5 w-full px-4 py-3 rounded-xl bg-[#34B27B] hover:bg-[#2d9e6c] active:bg-[#27885c] text-white font-medium text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-[#34B27B] focus-visible:ring-offset-2 focus-visible:ring-offset-[#09090b]"
>
Expand All @@ -188,6 +189,7 @@ export function EditorEmptyState({ onVideoImported, onProjectOpened }: EditorEmp
</button>
<button
type="button"
data-testid="editor-empty-load-project-button"
onClick={handleLoadProject}
className="flex items-center justify-center gap-2.5 w-full px-4 py-3 rounded-xl bg-white/5 hover:bg-white/10 border border-white/10 text-slate-300 font-medium text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-white/30 focus-visible:ring-offset-2 focus-visible:ring-offset-[#09090b]"
>
Expand Down
15 changes: 11 additions & 4 deletions tests/e2e/windows-native-checklist.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,13 @@ test.describe("Windows native checklist smoke tests", () => {
}));
}, testVideoInRecordings);

await hudWindow.getByTestId("launch-open-video-button").click();
await hudWindow.getByTestId("launch-open-studio-button").click();
const editorWindow = await app.waitForEvent("window", {
predicate: (w) => w.url().includes("windowType=editor"),
timeout: 15_000,
});
await editorWindow.waitForLoadState("domcontentloaded");
await editorWindow.getByTestId("editor-empty-import-video-button").click();
await expect(editorWindow.getByText("Loading video...")).not.toBeVisible({ timeout: 20_000 });

const playButton = editorWindow.locator(
Expand All @@ -208,8 +209,9 @@ test.describe("Windows native checklist smoke tests", () => {
await expect.poll(() => seekInput.inputValue(), { timeout: 10_000 }).not.toBe("0");

await expect(
editorWindow.getByText("Background").or(editorWindow.getByText("Arrière-plan")),
editorWindow.getByText("Background").or(editorWindow.getByText("Arrière-plan")).first(),
).toBeVisible();
await editorWindow.getByTestId("testId-export-panel-button").click();
await expect(editorWindow.getByTestId("testId-export-button")).toBeVisible();
} finally {
await closeApp(app);
Expand Down Expand Up @@ -262,7 +264,10 @@ test.describe("Windows native checklist smoke tests", () => {
return success({ success: false, canceled: true });
}
if (request.domain === "project" && request.action === "getCurrentVideoPath") {
return success({ success: true, path: payload.videoPath });
// No video set yet at editor mount time — the editor must show
// EditorEmptyState so the test can click "Load Project" itself,
// rather than short-circuiting straight into a "loaded" state.
return success({ success: false });
}
if (request.domain === "system" && request.action === "getPlatform") {
return success("win32");
Expand Down Expand Up @@ -301,13 +306,15 @@ test.describe("Windows native checklist smoke tests", () => {
},
);

await hudWindow.getByTestId("launch-open-project-button").click();
await hudWindow.getByTestId("launch-open-studio-button").click();
const editorWindow = await app.waitForEvent("window", {
predicate: (w) => w.url().includes("windowType=editor"),
timeout: 15_000,
});
await editorWindow.waitForLoadState("domcontentloaded");
await editorWindow.getByTestId("editor-empty-load-project-button").click();
await expect(editorWindow.getByText("Loading video...")).not.toBeVisible({ timeout: 20_000 });
await editorWindow.getByTestId("testId-export-panel-button").click();
await expect(editorWindow.getByTestId("testId-export-button")).toBeVisible();
} finally {
await closeApp(app);
Expand Down
Loading