docs(contractor-onboarding) - add tests for COR elegibility step#734
Conversation
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (283 total)
✅ Bundle size check passed |
|
Deploy preview for remote-flows ready! ✅ Preview Built with commit 2bf53dd. |
|
Deploy preview for remote-flows-example-app ready! ✅ Preview Built with commit 2bf53dd. |
|
npm warn exec The following package was not found and will be installed: tsx@4.21.0 📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
b892b0e
into
pbyr-3467-add-cor-product-to-product-prices
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
| expect( | ||
| screen.queryByText(/Step: Eligibility Questionnaire/i), | ||
| ).not.toBeInTheDocument(); |
There was a problem hiding this comment.
Test assertion is vacuously true and verifies nothing
Low Severity
In the "should call DELETE when changing from COR to different plan" test, the steps map at index [2] is 'Contract Details' and does not include 'Eligibility Questionnaire' at any index. Since the heading is rendered as Step: {steps[currentStepIndex]}, the text "Step: Eligibility Questionnaire" can never appear in the DOM regardless of whether the eligibility step is actually shown. This means the assertion screen.queryByText(/Step: Eligibility Questionnaire/i).not.toBeInTheDocument() always passes and doesn't actually verify that the eligibility step was skipped. If a regression caused the eligibility step to appear at index 2, the heading would instead display "Step: Contract Details" and this assertion would still pass.
…732) * unlock cor product price * add message * fieldValues * feat(contractor-onboarding) - add eligibility questionaire * call api to get eligibility schema * call api to get eligibility schema * feat(eligibility-questionnaire) - render json schema * call endpoint to see if questionaire is eligible * create cor intent * skip submitting form * delete intent cor * dynamic steps * fix keys * generate types * fix tests select country * fix test * fix size check * upgrade limits * add isSubmitting mutations * useMemo to avoid rerenders * fix ref * refetch subscriptions * fix 404 when switching * use parsedValues * fix logic * fix review * fix switching pricing plan cards * fix changed values * docs(contractor-onboarding) - add tests for COR elegibility step (#734) * add tests * add rule * add rule * trigger * create fixtures and global handlers * reorder mocks * fix fixture


Note
Medium Risk
Changes are test- and mock-focused, but updating global
defaultHandlerscan alter behavior across the test suite and may cause unintended test coupling or masking of missing mocks.Overview
Extends
ContractorOnboardingflow test coverage to include the Contractor of Record (COR) eligibility questionnaire step, verifying step insertion in the wizard, successful submission payload (POST /v1/contractors/eligibility-questionnaire) and navigation, pre-fill behavior when eligibility data is returned with subscriptions, and cleanup behavior when switching away from COR (DELETE /contractor-cor-subscription).Adds shared MSW fixtures for base responses, contractor subscription responses (including eligibility data), and the eligibility questionnaire schema, and makes related MSW handlers part of
defaultHandlersto reduce per-test setup. Also updates test helpers to support selecting specific subscription plans and filling the eligibility questionnaire, and adds Cursor rules for formatting and preferred radio assertions in tests.Written by Cursor Bugbot for commit 4274abe. This will update automatically on new commits. Configure here.