Split AccountEditPage.test.tsx by facet

Task 7615 · Done · Coder · created · updated

## Requirement (verbatim, epic 7555) > Break large modules into smaller and more structured ones. E.g. "Very large modules: routes/[tasks.py](http://tasks.py) has 12,867 lines and [models.py](http://models.py) has 8,770." Settled upstream (PRD = task 7553, Architecture = task 7554): split the 26 files over 3,000 lines frozen on 2026-10-18 — including the 15 test files over 3,000 lines — one domain per module, one PR per file, no shim, no size gate. This child is ONE of 21 independent PRs; no child depends on another. ## This child: `apps/web/src/pages/credentials/AccountEditPage.test.tsx` (3,182 lines) (Architecture §5.12 T10) - First hoist `openApiKeyAdd` (today mid-file ~2146) to the shared fixtures, then split into `AccountEditPage.<facet>.test.tsx` siblings, each named for one facet and opening with a one-line header comment naming it. - Shared helpers go to the existing `accountsTestFixtures.tsx` (extend it; don't duplicate). - `vi.mock(...)` calls stay in EACH test file (hoisted per file); only factory bodies are shared. - Tests move verbatim: no test deleted, skipped (`.skip`/`.todo`) or weakened. - C5: `git grep -nF 'AccountEditPage.test.tsx' -- apps/ tools/ '*.json' '*.yml' '*.sh'`; re-key every hit. - AD9 Delivery: merge lane is ON — do NOT arm auto-merge. Rebase on fresh `develop` immediately before each `pull_request_enqueue` (carry any upstream edits to the old file into the split files); enqueue after every push. Watch Jaah Deploy for the merge commit: on failure fix and enqueue again; cancelled/superseded → leave it. - Run `./dc check full` only on the committed, rebased tree, never in parallel with `./dc test` on the same slot. Credentials & reach: - AC5, AC6, AC7, O4, O-patch, O-catalog, O-mappers, O-cycle, O7 build | None beyond the worktree; the slot's local `./dc` stack (project p1-6) | verified on node h2: `./dc up` exit 0; `./dc run api alembic check` → "No new upgrade operations detected."; the in-process `app.openapi()` returned 726 paths and 1,037 schemas - AC9 / AD9: PR view, enqueue, Jaah Deploy watch | `jaah-forge`, pre-authenticated for the task, plus the `pull_request_enqueue` control tool; GitHub `jaah-ai/jaah` | verified: `jaah-forge api get repos/jaah-ai/jaah/actions/workflows` from node h2 listed the "Jaah Deploy" workflow Out of scope: Do NOT touch `AccountEditPage.tsx` or any production code (N1/N5). Do NOT split any other file (N2, N7). Do NOT add a line-count ceiling, lint rule or gate (N3). No barrel/re-export test module (N4). No new features, dependency bumps or behavioural fixes (N6). Do NOT rewrite git history (N8). Not applicable (no production code): AC4/O4, AC5, AC11; AC10 is reduced to the Jaah Deploy watch (Planner decision: no product surface changes; the project instruction 'Make sure you watch Jaah Deploy of your PR to succeed' still applies). Done means: - AC1 No §4 file remains over 3,000 lines, and no module created by the split is over 3,000 lines. — Run `git ls-files | grep -E '\.(py|ts|tsx|js|sh)$' | grep -v -E 'node_modules|alembic/versions|migrations/|packages/agent-sdk/examples/' | xargs wc -l | awk '$1>3000 && $2!="total"' | sort -rn` on `develop` after the PR; observe `AccountEditPage.test.tsx` absent and no new sibling listed. - AC2 Each new module owns one domain and declares it (R2). Fails if a module is a grab-bag (`utils2`, `misc`, `part2`, `helpers` mixing domains) or its docstring names two unrelated domains. — `for f in <new files>; do head -3 "$f"; done` → every file opens with a one-line ownership header comment; reviewer (code-review lane) confirms each file's tests match its stated facet and its name. Record the file→facet table in the PR body. - AC6 Full gate green. — `./dc check full --gate-result --timeout 1500` on the committed, rebased tree → `GATE_RESULT status=pass` (includes `tools/check_context.py`). - AC7 Coverage not reduced (R6). — Before/after: `npx vitest list | wc -l` (web) → after ≥ before; cite both numbers in the PR body. - AC8 Docs pointers current (R7). — `git grep -nF 'AccountEditPage.test.tsx' -- '*.md' '*.toml' '*.json' '*.yml'` → 0 hits (except git-history-only prose); `python3 tools/check_context.py` → exit 0. - AC9 Delivered one PR per file (R4). — `jaah-forge pr view <n>` → diff touches only this test file's split + shared test fixtures; merged into `develop` through the merge lane after `pull_request_enqueue` (not auto-merge), shown MERGED; Jaah Deploy for the merge commit succeeded (or was cancelled/superseded). - AC12 Quality: the result is more navigable, not just shorter. Fails if a split produces circular-import workarounds (function-local imports added only to dodge cycles), duplicated code across new modules, or modules so thin (one trivial function) that a reader must open many files to follow one flow. — Code-review lane on the PR (incl. no duplicated mock factories across files); reviewer verdict recorded in the PR body.

Outcome

Split AccountEditPage.test.tsx (3,182 lines) into 8 facet suites (all 165 tests unchanged) plus shared fixtures/render helpers. Quick gate green, lane full gate green, merged as fe603f77d. Jaah Deploy was cancelled/superseded; left alone.

Pull request

Artifacts

Activity

  • Draft
  • Ready
  • Runner started
  • Runner ended (done)