Skip to content

docs(contractor-onboarding) - add tests for COR elegibility step#734

Merged
gabrielseco merged 7 commits intopbyr-3467-add-cor-product-to-product-pricesfrom
add-tests-for-eligibility-cor
Feb 12, 2026
Merged

docs(contractor-onboarding) - add tests for COR elegibility step#734
gabrielseco merged 7 commits intopbyr-3467-add-cor-product-to-product-pricesfrom
add-tests-for-eligibility-cor

Conversation

@gabrielseco
Copy link
Collaborator

@gabrielseco gabrielseco commented Feb 12, 2026

  • Added tests for the COR new logic
  • Add new cursor rules to help with AI
  • add fixtures and handlers to make some behavior as default

Note

Medium Risk
Changes are test- and mock-focused, but updating global defaultHandlers can alter behavior across the test suite and may cause unintended test coupling or masking of missing mocks.

Overview
Extends ContractorOnboarding flow 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 defaultHandlers to 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.

@gabrielseco gabrielseco changed the base branch from main to pbyr-3467-add-cor-product-to-product-prices February 12, 2026 09:40
@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 186.41 kB 184.64 kB +1.77 kB (+1.0%) 🔴
Total (raw) 498.9 kB 492.64 kB +6.26 kB (+1.3%) 🔴
CSS (gzip) 19.35 kB 19.35 kB 0 B (0%) 🟢
CSS (raw) 101.78 kB 101.78 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 186.41 kB / 200 kB (93.2%)
  • ✅ Total raw: 498.9 kB / 550 kB (90.7%)
  • ✅ CSS gzipped: 19.35 kB / 25 kB (77.4%)

Largest Files (Top 5)

  1. chunk-ZSJ6YADQ.js - 12.43 kB (new)
  2. styles.css - 9.68 kB (0 B (0%))
  3. index.css - 9.68 kB (0 B (0%))
  4. index.js - 5.87 kB (+15 B (+0.3%))
  5. chunk-ZHRMPK42.js - 5.61 kB (new)
View All Files (283 total)
File Size (gzip) Change
chunk-ZSJ6YADQ.js 12.43 kB new
styles.css 9.68 kB 0 B (0%)
index.css 9.68 kB 0 B (0%)
index.js 5.87 kB +15 B (+0.3%)
chunk-ZHRMPK42.js 5.61 kB new
chunk-RBVGOVSD.js 4.07 kB new
chunk-DG7WU355.js 3.76 kB new
chunk-T7O3YYOG.js 3.29 kB 0 B (0%)
chunk-HVG6VCP4.js 3.29 kB new
chunk-MKSMTFPZ.js 3.21 kB new

✅ Bundle size check passed

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

Deploy preview for remote-flows ready!

✅ Preview
https://remote-flows-8mh5iqi7y-remotecom.vercel.app

Built with commit 2bf53dd.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

Deploy preview for remote-flows-example-app ready!

✅ Preview
https://remote-flows-example-ay7zvn3ii-remotecom.vercel.app

Built with commit 2bf53dd.
This pull request is being automatically deployed with vercel-action

@gabrielseco gabrielseco changed the base branch from pbyr-3467-add-cor-product-to-product-prices to main February 12, 2026 09:47
@github-actions
Copy link
Contributor

npm warn exec The following package was not found and will be installed: tsx@4.21.0

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 87.80% 87.66% +0.14% 🟢
Statements 87.45% 87.29% +0.15% 🟢
Functions 83.71% 83.32% +0.39% 🟢
Branches 79.46% 79.27% +0.19% 🟢

Detailed Breakdown

Lines Coverage
  • Covered: 2994 / 3410
  • Coverage: 87.80%
  • Change: +0.14% (88 lines)
Statements Coverage
  • Covered: 3051 / 3489
  • Coverage: 87.45%
  • Change: +0.15% (90 statements)
Functions Coverage
  • Covered: 858 / 1025
  • Coverage: 83.71%
  • Change: +0.39% (24 functions)
Branches Coverage
  • Covered: 1888 / 2376
  • Coverage: 79.46%
  • Change: +0.19% (37 branches)

✅ Coverage check passed

@gabrielseco gabrielseco changed the base branch from main to pbyr-3467-add-cor-product-to-product-prices February 12, 2026 10:00
@gabrielseco gabrielseco self-assigned this Feb 12, 2026
@gabrielseco gabrielseco changed the title Add tests for eligibility cor docs(contractor-onboarding) - add tests for COR elegibility step Feb 12, 2026
@gabrielseco gabrielseco marked this pull request as ready for review February 12, 2026 12:44
@gabrielseco gabrielseco merged commit b892b0e into pbyr-3467-add-cor-product-to-product-prices Feb 12, 2026
1 check passed
@gabrielseco gabrielseco deleted the add-tests-for-eligibility-cor branch February 12, 2026 13:15
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

gabrielseco added a commit that referenced this pull request Feb 12, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants