Repository navigation
feat(agents): issue-45-add-web-test-harness-rateslider-anchorin - #46
Conversation
Wires up vitest + jsdom + @testing-library/react as the web test infrastructure and adds ten test cases (T1-T10) covering want/give anchoring, slider interaction, wantAmount prop updates, pair changes, edge-case input handling, and API failure fallback for RateSlider. Adds npm test step to the web CI job. Proposal: platform-gitops/agents-state/mctl-pairdesk/proposals/issue-45-add-web-test-harness-rateslider-anchorin/
|
Claude finished @mashkovd's task in 4m 7s —— View job Review complete — approved
Verdict: Approved — no P1/P2 findings (1 P3 nit). What this PR doesTest-only addition: a Vitest + jsdom + React Testing Library harness, a new Why it's safe
Test logic vs. the component (spot-checked)
Findings
|
| @@ -0,0 +1 @@ | |||
| import '@testing-library/jest-dom'; | |||
There was a problem hiding this comment.
P3 — Nit, non-blocking. With @testing-library/jest-dom@^6.6 and vitest@^2, the recommended (and documented) entry point that augments vi.Assertion matcher types is the /vitest subpath. The bare import registers matchers at runtime but in some TS setups doesn't extend Vitest's expect typings, so editor / tsc may not know about .toBeInTheDocument(). Since CI runs type-check before npm test, switching to the /vitest path is the safer form.
| import '@testing-library/jest-dom'; | |
| import '@testing-library/jest-dom/vitest'; |
There was a problem hiding this comment.
No P1/P2 findings (1 P3). Test-only addition (vitest harness + 10 RateSlider anchoring tests, CI npm test step, dev-deps). No runtime/source changes; no concurrency, serializer, RBAC, or initData impact. Test logic verified against components.tsx RateSlider — anchoring via lastEditedField ref, rate-resolution effects, and the rate=0 / blur-autofill / API-failure edge paths all line up. Good to merge.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12b0bb8365
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1 @@ | |||
| import '@testing-library/jest-dom'; | |||
There was a problem hiding this comment.
Use the Vitest jest-dom entrypoint
In the web CI job I checked, npm run type-check runs before npm test; this setup file imports the Jest entrypoint, which does not augment Vitest's Assertion type. Because the new test imports expect from vitest and uses toBeInTheDocument(), a clean install will fail type-checking; import @testing-library/jest-dom/vitest instead.
Useful? React with 👍 / 👎.
Implements accepted proposal
mctl-pairdesk/issue-45-add-web-test-harness-rateslider-anchorin.Spec: https://github.com/mctlhq/mctl-gitops/tree/main/platform-gitops/agents-state/mctl-pairdesk/proposals/issue-45-add-web-test-harness-rateslider-anchorin/
Generated by mctl-agents Tier 2 implementer. Review carefully — this PR was opened automatically and the spec may have gaps.
Closes #45