Skip to content

fix(e2e): seed a real project so the sidebar rename spec stops racing - #2022

Merged
jackwener merged 1 commit into
mainfrom
fix/sidebar-e2e-project-seed
Aug 4, 2026
Merged

fix(e2e): seed a real project so the sidebar rename spec stops racing#2022
jackwener merged 1 commit into
mainfrom
fix/sidebar-e2e-project-seed

Conversation

@jackwener

Copy link
Copy Markdown
Member

The project rename owns Enter spec blocked four PRs tonight with an intermittent 30s click timeout. Root cause: the long-sidebar fixture never seeds a project — real project rows only appear after the app asynchronously self-registers the workspace, a race the test sometimes lost. On a loss only the 未归属项目 pseudo-group exists, whose row legitimately has no 项目操作 trigger.

Deterministic fix (fixture): seed projects.json (one record, location = live workspace root so the catalog presents it available) alongside the 60-session seed, and link the three newest sessions via a new projectId passthrough in header(). The seed is shared by seven scenarios; default grouping is by-time, so none of their surfaces change.

Spec hardening: anchor on the seeded 示例项目 row (not .first()); open the menu via focus+Enter (the suite's own openFocusedMenu idiom — the trigger nests inside SideNavItem's composite button, where pointer hit-testing is timing-sensitive); sidebar-scope the rename textbox (entering rename swaps row content for the input, so a name-filtered row locator can't match mid-edit).

Verification: sidebar spec 7/7 × 5 consecutive runs (~2× faster — no timeout retries) · full local e2e green modulo two known parallel-load flakes that pass 8/8 standalone with and without this change · fixture unit tests 73/73 · typecheck/format/checks ✅

Self-reviewed per the standing instruction.

The 'project rename owns Enter' spec blocked four PRs tonight with a
30s click timeout that came and went between runs. Root cause: the
long-sidebar fixture never seeds a project — real project rows only
exist after the app ASYNCHRONOUSLY self-registers the workspace, a
race the test sometimes lost. When it lost, only the 未归属项目
pseudo-group existed, whose row legitimately has no 项目操作 trigger,
so the click waited out its timeout.

Fixture (the deterministic fix):
- seed-helpers exports LONG_SIDEBAR_PROJECT_{ID,NAME} and header()
  learns a projectId passthrough; the three newest long-sidebar
  sessions link to the project.
- The fixture writes projects.json (schemaVersion 1, one record whose
  location is the live workspace root, so the catalog presents it as
  available) alongside the 60-session seed. The seed is shared by
  seven scenarios; grouping is by-time by default, so none of their
  surfaces change.

Spec hardening:
- The project locator anchors on the seeded 示例项目 name instead of
  `.first()` (which could land on the pseudo-group).
- The menu opens via focus + Enter — the suite's established
  menu-trigger idiom (plan-reminders' openFocusedMenu) — instead of
  pointer hit-testing a trigger nested inside SideNavItem's composite
  button.
- The rename textbox is sidebar-scoped: entering rename swaps the row
  content for the input, so a name-filtered row locator cannot match
  while editing (hasText does not read input values).

Verified: sidebar spec 7/7 across five consecutive runs (and ~2x
faster — no more timeout retries); full local e2e suite green modulo
two known parallel-load flakes that pass 8/8 standalone both with and
without this change; fixture unit tests 73/73; typecheck / format /
checks green.
@jackwener
jackwener merged commit 2e30bd8 into main Aug 4, 2026
11 checks passed
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.

1 participant