Repository navigation
test(web): exhaustive match classification truth table and mixed e2e - #41
Conversation
Add a 5×5 rating truth table (25 pairs) and a timing matrix (36 combos) to classify-match unit tests. Rework the "mixed answers" e2e test so Alice and Bob use different rating arrays, producing match/possible/ both-maybe/fantasy on the same results page. Add offset param to answerQuestionsCycling helper. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe pull request adds an optional Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Test changes (exhaustive truth table, mixed e2e, offset param) were accidentally bundled with this design-polish PR. Moved to dedicated PR #41 (test/exhaustive-match-classification). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
e2e/results.spec.ts (1)
69-76: Array spreading is unnecessary but harmless.Since
aliceRatingsandbobRatingsare already separate arrays with different values, the offset parameter isn't needed here. The spread syntax[...aliceRatings]converts the readonly tuple to a mutable array, which isn't required sinceanswerQuestionsCyclingdoesn't mutate the input.This works correctly as-is; just noting the spread could be removed for simplicity if desired.
♻️ Optional: Remove unnecessary spreads
- await answerQuestionsCycling(alice, [...aliceRatings]); + await answerQuestionsCycling(alice, aliceRatings); await alice.getByRole("button", { name: "I'm done" }).click(); await expect(alice.getByText("Waiting for everyone")).toBeVisible(); await bob.goto(partnerLink); await goThroughIntro(bob); await narrowToCategory(bob, "Group & External"); - await answerQuestionsCycling(bob, [...bobRatings]); + await answerQuestionsCycling(bob, bobRatings);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@e2e/results.spec.ts` around lines 69 - 76, The test unnecessarily spreads the readonly tuples aliceRatings and bobRatings into new arrays before passing them to answerQuestionsCycling; remove the spreads and pass aliceRatings and bobRatings directly to answerQuestionsCycling (i.e., change answerQuestionsCycling(alice, [...aliceRatings]) to answerQuestionsCycling(alice, aliceRatings) and similarly for bob) since answerQuestionsCycling does not mutate its input.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@e2e/results.spec.ts`:
- Around line 69-76: The test unnecessarily spreads the readonly tuples
aliceRatings and bobRatings into new arrays before passing them to
answerQuestionsCycling; remove the spreads and pass aliceRatings and bobRatings
directly to answerQuestionsCycling (i.e., change answerQuestionsCycling(alice,
[...aliceRatings]) to answerQuestionsCycling(alice, aliceRatings) and similarly
for bob) since answerQuestionsCycling does not mutate its input.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f27b65a0-9070-468b-b920-aaa8233c421f
📒 Files selected for processing (3)
e2e/helpers.tse2e/results.spec.tspackages/web/src/lib/classify-match.test.ts
Accept `readonly Rating[]` in answerQuestionsCycling so callers can pass `as const` tuples directly without spreading. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* feat(web): refine design with tactile depth and editorial polish Elevate the Peach & Sage palette with gradient buttons, warm layered shadows, spring-curve animations, and consistent visual hierarchy across all screens — while preserving the safe, ND-friendly character. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * refactor(web): address CodeRabbit review feedback - Extract gradient colors to CSS tokens (--color-accent-dark, etc.) - Centralize easing curve as --ease-spring CSS variable - Extract shared variantStyles to lib/variant-styles.ts - Use animation: none in prefers-reduced-motion (not just duration) - Use stable key={step} instead of key={i} in Intro.tsx Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * refactor(web): extract shadow/progress CSS tokens, reduce className noise - Add shadow theme tokens (--shadow-accent-sm, --shadow-accent-md, --shadow-accent-light-sm) to replace 10+ inline arbitrary values - Add .shadow-accent-embossed for compound shadow + inset highlight - Add .progress-track, .progress-fill, .progress-glow CSS utilities replacing 6 inline style props across QuestionCard and Summary - Use cn() consistently for conditional classNames (not template literals) - Document cn() convention in CLAUDE.md Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * refactor(web): extract CopyLinkField component, enforce cn() everywhere - Extract CopyLinkField component for the repeated link input + copy button + sr-only pattern (3 instances across GroupSetup and Invite) - Convert all 14 template-literal classNames to cn() across 8 files - Zero `className={\`...\`}` patterns remaining in codebase Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * refactor(web): remove test changes — moved to #41 Test changes (exhaustive truth table, mixed e2e, offset param) were accidentally bundled with this design-polish PR. Moved to dedicated PR #41 (test/exhaustive-match-classification). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * test(web): regenerate visual regression baselines All 60 screenshots updated to match the new design polish: gradient buttons, warm shadows, spring animations, refined typography. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
The offset can't produce all match types with a single array (fantasy only matches itself), so the mixed-answers test uses two explicit arrays instead. Remove the speculative parameter. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
🎉 This PR is included in version 1.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
classifyMatchunit tests — documents every(ratingA, ratingB) → matchTypecell as a 2D arraymatch,possible,both-maybe, andfantasyall appear on the same results page (previously both answered "maybe" → onlyboth-maybe)offsetparameter toanswerQuestionsCyclinghelper for shifting the starting indexTest plan
pnpm vitest run packages/web/src/lib/classify-match.test.ts— 100 tests pass (was 39)pnpm test:e2e -- e2e/results.spec.ts— 4/4 e2e tests pass🤖 Generated with Claude Code
Summary by CodeRabbit