Skip to content

fix(test): repair windows-native-checklist.spec.ts's broken open-video/open-project flow#132

Open
EtienneLescot wants to merge 1 commit into
mainfrom
fix/130-broken-e2e-testids
Open

fix(test): repair windows-native-checklist.spec.ts's broken open-video/open-project flow#132
EtienneLescot wants to merge 1 commit into
mainfrom
fix/130-broken-e2e-testids

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #130.

Two tests in tests/e2e/windows-native-checklist.spec.ts referenced hudWindow testids (launch-open-video-button, launch-open-project-button) that don't exist anywhere in LaunchWindow.tsx. Since this spec self-skips off-Windows (test.skip(process.platform !== "win32")) and CI runs on Linux only per AGENTS.md, these two tests have apparently never actually executed — they'd fail immediately on first real run against Windows.

What changed

  • EditorEmptyState.tsx: added data-testid to the "Import Video File…" and "Load Project…" buttons — they had no selector at all before.
  • windows-native-checklist.spec.ts: routed both tests through the real flow (HUD → "Open Studio" → editor empty state → the new testids), instead of the nonexistent direct HUD buttons.
  • Fixed the getCurrentVideoPath mock in the load-project test: it stubbed a video as already current, which made VideoEditor skip past EditorEmptyState entirely once the flow actually went through it — a real bug in the mock that the broken navigation path had been masking.
  • Two more bugs the same execution gap let through, found while verifying locally: a strict-mode-violating "Background" text locator matching two elements, and an assertion on the export button before ever opening the export panel that renders it.

Testing

Verified locally on macOS by temporarily bypassing the win32-only skip (not part of this diff — reverted before committing): npm run build-vite then npx playwright test tests/e2e/windows-native-checklist.spec.ts. Both previously-broken tests (launch window opens an existing video... and launch window opens an existing project...) now pass end-to-end. The third test in the file (native source-selector enumeration) still fails on macOS as expected — that path is genuinely Windows-only (WGC vs ScreenCaptureKit) and untouched by this PR.

tsc --noEmit, biome check ., and npm run test (427/427) all clean.

Summary by CodeRabbit

  • Tests
    • Improved Windows end-to-end coverage for opening videos and projects through the editor’s empty state.
    • Added reliable test targeting for the “Import video” and “Load project” buttons.
    • Updated test flows to verify background visibility, loading completion, and export panel access.

…o/open-project flow

Fixes #130. Two tests referenced hudWindow testids
(launch-open-video-button, launch-open-project-button) that don't exist
anywhere in LaunchWindow.tsx -- the spec self-skips off-Windows and CI is
Linux-only, so this had never actually been caught by a real run.

- Add data-testid to EditorEmptyState's Import Video File / Load Project
  buttons (previously untestable, no selector at all).
- Route both tests through the real flow: HUD "Open Studio" -> editor
  empty state -> the new testids.
- Fix the getCurrentVideoPath mock in the load-project test: it stubbed a
  video as already current, which made VideoEditor skip past
  EditorEmptyState entirely once the flow went through it (real bug in
  the mock, exposed by fixing the navigation path).
- Two more bugs the same execution gap let through, fixed while verifying
  locally: a strict-mode-violating "Background" text locator matching two
  elements, and an assertion on the export button before ever opening the
  export panel that renders it.

Verified locally on macOS by temporarily bypassing the win32-only skip:
both previously-broken tests now pass end-to-end (build-vite + playwright
test tests/e2e/windows-native-checklist.spec.ts).
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 96d38a54-37be-4d0d-a566-34463de607a9

📥 Commits

Reviewing files that changed from the base of the PR and between 8b4a118 and b243377.

📒 Files selected for processing (2)
  • src/components/video-editor/EditorEmptyState.tsx
  • tests/e2e/windows-native-checklist.spec.ts

📝 Walkthrough

Walkthrough

The editor empty-state import and load-project buttons now have test identifiers. Windows native checklist tests enter through Open Studio, use those buttons, adjust the mocked video-path response, and verify editor readiness before opening export.

Changes

Windows editor entry flows

Layer / File(s) Summary
Add editor empty-state selectors
src/components/video-editor/EditorEmptyState.tsx
Adds dedicated test identifiers to the import video and load project buttons.
Align Windows checklist flows
tests/e2e/windows-native-checklist.spec.ts
Updates video and project tests to enter through Open Studio, interact with the editor empty state, adjust the mocked current-video response, and verify the editor before opening export.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main fix to the broken Windows e2e flow and affected spec file.
Description check ✅ Passed The description includes a summary, linked issue, and testing details, though some optional checklist sections are omitted.
Linked Issues check ✅ Passed The changes address issue #130 by adding selectors and updating the tests to use the real HUD to empty-state flow.
Out of Scope Changes check ✅ Passed The extra locator, mock, and export-panel fixes are directly tied to getting the affected tests working and are not unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/130-broken-e2e-testids

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

windows-native-checklist.spec.ts references testids that don't exist (launch-open-video-button, launch-open-project-button)

2 participants