You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(frontend): separate purchase-modal regression suites without duplicating setup #332
Extract shared purchase-modal test setup and separate the single-bucket and fan-out regression suites so each TypeScript file remains under the project's 500-line guideline.
Current behavior
frontend/src/__tests__/purchase-modal-submit.test.ts in LeanerCloud/cloud-commitments-cli#2071 is 603 lines at 664f80600744d845e5c0af5f30175bf259c8db07. Both suites exercise the real app and modal modules with shared mocks and DOM setup. This is a maintainability issue, not a demonstrated runtime defect.
Expected behavior and proposed change
Keep the same behavioral coverage and test execution order semantics. Move the fan-out cases into a separate test file and extract only the setup genuinely shared by the two suites. Do not duplicate mocks, drop assertions, or change production code.
Verification
Run both suites independently and together, then the frontend suite and typecheck. Confirm every existing regression still runs, including real executePurchase payload assertions and the new in-flight submission tests. Keep module mocking/initialization order intact.
CodeRabbit renewed the test split request on PR LeanerCloud/cloud-commitments-cli#2071 at LeanerCloud/cloud-commitments-cli#2071 (comment). The suite is now 744 lines at 8c00eafc10bbe0fb88fc89f192376ba94720513a (the later local comment-only correction removes two lines). Preserve the additional pending-submit, cancel and exception-cleanup regressions as well as the single/fan-out pricing payload scenarios when splitting. Shared setup must retain Jest mock and module initialization order; run split suites independently and together. The broader recommendations.ts / recommendations.test.ts extraction remains #210. No structural change is bundled into the active purchase-correctness fix.
Activity
cristim commentedon Sep 11, 2026
CodeRabbit renewed the test split request on PR LeanerCloud/cloud-commitments-cli#2071 at LeanerCloud/cloud-commitments-cli#2071 (comment). The suite is now 744 lines at 8c00eafc10bbe0fb88fc89f192376ba94720513a (the later local comment-only correction removes two lines). Preserve the additional pending-submit, cancel and exception-cleanup regressions as well as the single/fan-out pricing payload scenarios when splitting. Shared setup must retain Jest mock and module initialization order; run split suites independently and together. The broader recommendations.ts / recommendations.test.ts extraction remains #210. No structural change is bundled into the active purchase-correctness fix.