Repository navigation
test(members): split MembersPage.test.tsx by topic - #21553
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. [UX-REVIEWED] 5dbc54a Description read[DESCRIPTION-READ] 4526a0264b9f034d4fc5bab47c2713717d7c9bdd3152500dcccc31d706752077 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. Suggestions
[DESIGN-REVIEWED] 5dbc54a Description read[DESCRIPTION-READ] 0fec17928f06a3e920909f756a871bcae5486668fa3388ea3d0afa16041210f1 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
MembersPage.test.tsx had grown to 6,611 lines, over the 2,000-line cap. Its describes now live in eight sibling files beside it, one topic each (sidePanel, teams, openThread, newCrewmate, newCrewmateOutcomes, createLinks, landing, narrow); the original keeps the roster, its cached read and opening a thread. Module-level fixtures move to src/test/MembersPageTestUtils.tsx. Every file carries the original's vi.mock factories and top-level hooks word for word, so each moved test runs against exactly the stubs and resets it was written with. Test bodies move byte-for-byte; the same 274 tests run, under the same full names. Moved lines that the added-line gates re-judge carry their markers: the six promise-sleeps in the New crewmate part get an own-line flake-ok and nosemgrep pair, the five Date.now() stamps in openThread and the helper's useFakeTimers get a same-line flake-ok, and two moved comments now name the file that holds what they cite (chat-sidebar/SessionRow.tsx, and the below-md block in MembersPage.narrow.test.tsx). The act() warning baseline entry moves with the two New crewmate cases that emit it, and the line-cap baseline row is deleted. The comment in test/test_members_roster_recency.py that named MembersPage.test.tsx now names the file that holds what it cites; MembersPage.schedules.test.tsx loses a sentence giving a reason that no longer holds (the below md describe restores matchMedia after each case). Part of #20192
b73f0ee to
5dbc54a
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (14 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: splits MembersPage.test.tsx into topic files with a shared test-utils module; only test files, the line-cap baseline and the act-warning test baseline change.
Problem / Motivation
Goal: Bring
website/src/pages/members/MembersPage.test.tsx(6,611 lines) under the 2,000-line cap by moving its tests unchanged into topic files beside it.The Crewmates page's main test file mixes the roster, the side panel, teams, the New crewmate card, create links, landing rules and the phone layout in one file. A reader cannot tell where a new case belongs, and every Crewmates PR edits a 6,600-line file.
Why it matters
The campaign rule in #20192 is that no hand-written file exceeds 2,000 lines. This is the largest frontend test file on the line-cap baseline, and it is one of the most edited (31 commits in seven days). While it stays this size, the next Crewmates fix lands in a file nobody can scan, and the guard has to keep carrying it.
Not a goal
What changed (motivation → approach → change)
The original covered a dozen behaviours with only its
describeblocks as seams. The split follows those describes; the three that were over a thousand lines on their own (side panel …,New crewmate dialog,default member, memory and URL) are cut into topic spans, and each span keeps the describe's title so every test keeps its full name.MembersPage.test.tsxMembersPage.sidePanel.test.tsxMembersPage.teams.test.tsxMembersPage.openThread.test.tsxMembersPage.newCrewmate.test.tsxMembersPage.newCrewmateOutcomes.test.tsxMembersPage.createLinks.test.tsxMembersPage.landing.test.tsxMembersPage.narrow.test.tsxsrc/test/MembersPageTestUtils.tsxrow,renderPageand its probes, the "+" menu drivers, the bounded-create clock,resetApiMocksEvery test file carries the original's vi.mock block and top-level
beforeEach/afterEach(realCreateClock)word for word. A helper read by one file stays in that file. A script in the campaign's control directory performs the split from any base: it finds each describe and test by title, never by line number, and exits if one is missing.Placement calls:
--minimaladd the same 27 lines to it.newCrewmate, and the act-warning baseline entry moves with them (472 entries before and after). The original emits none in three HEAD runs.src/test/: underpages/members/its name would match the page's owner rule (membersPageFamily), the feature-map gate and the ui-index walk.Outside the split itself: the original's row leaves
.github/file-line-cap-baseline.txt; the act-warning entry moves as in (b); the comment intest/test_members_roster_recency.pynames the file that now holds what it cites (src/test/CrewEditorDialog.test.tsx, the other file whose comment named the original, is deleted on main by #19257); andMembersPage.schedules.test.tsxdrops a sentence whose reason no longer holds (thebelow mddescribe restoresmatchMediaafter each case), an accuracy fix to a comment that named the original.CI path references: none. No workflow, AUTOSDE glob or path list names the original.
Move audit
Unit proof: 243 BASE units (each test, nested describe, helper, mock-block statement and hook); 234 occur byte-identical in the family (tests and helpers exactly once, the mock block and hooks once per test file), and 9 carry only the declared edits:
const settleinNew crewmate dialog// flake-ok:and// nosemgrep: semgrep.kirocrew.test-promise-sleep -- …pair above each of the six moved promise-sleeps// flake-ok:on its fiveDate.now()stampssetSystemTime, openThread has nonefakeCreateClock(helper module)// flake-ok:on itsvi.useFakeTimersrealCreateClockafter each case(ChatSidebar.tsx:2197, :6550)->(chat-sidebar/SessionRow.tsx)SessionRow.tsx;ChatSidebar.tsxis 939 linesnarrowEverything else that differs is glue: each file's pruned imports, the helper-module import, the helper module's imports and
exportprefixes, and a three-to-five-line intro comment per file. Comments copied with the mock block and theafterEach(for example "the status-strip and bounded-create cases") keep naming cases that live in some of the files only; they are verbatim.Backwards compatibility
Compatible: test-only change. No test file imports another, and every test keeps its name, body and pass condition.
Removes nothing: no test, assertion or export is removed. The original keeps its path, and the same 274 tests run.
Tests
The collected test list is identical: 274 tests (262
it/it.eachstatements) under the same full names, in one file at BASE and in nine files at HEAD (27 + 37 + 30 + 26 + 28 + 42 + 18 + 42 + 24).api.*mock's calls and settled results, the file's module spies and every act() warning. Against the unsplit file at this PR's base: every HEAD test's traffic matches a BASE run (274 of 274; earlier bases: four BASE runs against five HEAD runs, all matched). The BASE runs are not identical to each other at the tail (late refetches, a duplicate re-POST), so the match allows a timing-dependent tail and collapses consecutive duplicates.newCrewmate(listed). The nine files pass underKIROCREW_ACT_STRICT=1.src/or read files by path, plussetup.refactor.determinism.test.tsand the two comment-edited test files: 3,039 tests, all green (run before the last rebase, which only ports upstream test hunks).KIROCREW_ACT_STRICT=1, 274 of 274 each; the nine files plus the act-baseline self-test and the comment-edited schedules file, strict: 332 of 332.test_flake_pattern_ratchet.py,test_file_line_cap.pyandtest_members_roster_recency.py: 205 passed.scripts/check_file_line_cap.py: 0 failures.semgrep/and--baseline-commit: 0 findings; with--disable-nosem, exactly the six marked sleeps. Every file reports the same partial parse at the ChatPane stub'simport('react')type that the original reports at BASE.npx eslint src/ --max-warnings 0,npm run typecheck, the i18n and phantom-class checks, the brand, comment-history, focus-cue and feature-map gates anddocs_lint.py: all pass.scripts/local-gate.py --dry-runselects 879 backend and 378 frontend files, almost all from the cross-surface set, so it was not run whole; the floor above stands in for it.Manual verification
N/A — unit coverage sufficient: the change only moves vitest cases, and the identical test list plus the differential harness prove it.
Related Issues
Part of #20192
Follow-up: #20383 (pre-existing shapes moved verbatim; de-flake there)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)