Skip to content

refactor company tests#804

Open
gabrielseco wants to merge 2 commits intoreduce-bundle-sizefrom
refactor-tests-fixtures
Open

refactor company tests#804
gabrielseco wants to merge 2 commits intoreduce-bundle-sizefrom
refactor-tests-fixtures

Conversation

@gabrielseco
Copy link
Collaborator

@gabrielseco gabrielseco commented Mar 20, 2026

Note

Low Risk
Low risk: changes are limited to test fixtures and MSW handler setup, with no production logic modifications. Main risk is test brittleness if shared default handlers now return data that some tests implicitly relied on overriding.

Overview
Refactors onboarding-related tests to rely on shared MSW defaultHandlers instead of per-test stubs for GET /v1/companies/:companyId and benefit-offers endpoints.

Moves previously in-test fixtures (companyResponse, benefitOffersResponse, benefitOffersSchema) into common API fixtures by adding mockCompanyResponse in fixtures/companies.ts and introducing fixtures/employments.ts, and wires these into src/tests/handlers.ts. Updates invite/onboarding tests to reference mockCompanyResponse when overriding credit-risk scenarios, and removes redundant mocks/imports accordingly.

Written by Cursor Bugbot for commit 93f7093. This will update automatically on new commits. Configure here.

@gabrielseco gabrielseco marked this pull request as ready for review March 20, 2026 19:05
@gabrielseco gabrielseco changed the base branch from reduce-bundle-size to main March 20, 2026 19:06
@gabrielseco gabrielseco changed the base branch from main to reduce-bundle-size March 20, 2026 19:08
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.

1 participant