Skip to content

fix: resolve E2E editor test strict mode violations from leftover content (#140)#142

Merged
zacharias-ona merged 1 commit into
mainfrom
fix/140-e2e-strict-mode-violations
Apr 17, 2026
Merged

fix: resolve E2E editor test strict mode violations from leftover content (#140)#142
zacharias-ona merged 1 commit into
mainfrom
fix/140-e2e-strict-mode-violations

Conversation

@zacharias-ona
Copy link
Copy Markdown
Collaborator

Closes #140

What

5 E2E editor tests failed against production due to Playwright strict mode violations and element-not-found errors. Tests typed content into the editor but used locators that either matched multiple elements (pre-existing bold text, headings from prior runs) or targeted the wrong element type (looking for <p> when text landed inside <li> within a bullet list).

How

Three fixes across the three affected test files:

  • editor-drag.spec.ts: Added a moveToParagraphBlock helper that presses Enter twice to exit any active list context before typing. Used unique Date.now() markers in all three drag tests so locators never match leftover content. Switched from pressSequentially to page.keyboard.type() for reliability.
  • editor-slash-commands.spec.ts: Changed editor.locator("h1") to editor.locator("h1").last() so the assertion targets the newly inserted heading instead of matching a pre-existing one. Added a count-before/count-after check to verify insertion.
  • editor-toolbar.spec.ts: Both bold tests now use unique Date.now() markers and filter the strong locator with .filter({ hasText: marker }) to avoid matching pre-existing bold elements from prior runs.

Testing

All 11 tests in the three affected files pass locally (previously 3 drag + 1 slash command + 2 toolbar = 5 failures). Full CI suite: pnpm lint && pnpm typecheck && pnpm test all pass. E2E run: 11/11 passed.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Apr 16, 2026 11:58pm

Request Review

@zacharias-ona zacharias-ona merged commit b727855 into main Apr 17, 2026
6 checks passed
@zacharias-ona zacharias-ona deleted the fix/140-e2e-strict-mode-violations branch April 17, 2026 00:00
@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ UI verification skipped — no UI files changed. Only E2E test files (e2e/) were modified.

@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

❌ Post-merge verification failed (1/42 E2E tests).

E2E suite: 41 passed, 1 failed

  • search with no matches shows empty state — search dropdown shows loading skeletons instead of "No pages match your search"

Ad-hoc smoke tests: all passed

  • ✅ Landing page (200, has title)
  • ✅ Sign-in page (email input present)
  • ✅ Health endpoint (200, not down)
  • ✅ Authenticated login + workspace load
  • ✅ Editor navigation + render

The search empty state failure is a pre-existing bug unrelated to this PR's editor test changes. See #144.

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.

bug: E2E editor tests flaky — strict mode violations from leftover content

1 participant