Skip to content

test: cover deposit PI races, Identity fail-close, offboarding - #52

Draft
cursor[bot] wants to merge 5 commits into
mainfrom
cursor/missing-test-coverage-86e9
Draft

test: cover deposit PI races, Identity fail-close, offboarding#52
cursor[bot] wants to merge 5 commits into
mainfrom
cursor/missing-test-coverage-86e9

Conversation

@cursor

@cursor cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

Unique vs open consolidators #49/#50 (does not re-add their suites):

  • Deposit PaymentIntent races — in-flight processing rows block retries (DUPLICATE_PAYMENT); cancel-vs-succeeded / cancel-vs-processing / already-canceled paths for abandoned deposit PIs
  • Stripe Identity collections fail-close — verified sessions without legal name or 9-digit SSN/id_number (incl. TEST redaction / object id_number) must not pass profile checks
  • Offboarding checklist status — active detection, tenant vs staff completed counts, resolveStepMeta
  • Activity body redaction — nested password/token fields → [redacted]
  • Payments-health policysk_live/sk_test mode detection; www/bare webhook hosts from CLIENT_ORIGIN; localhost/malformed origin handling

Tiny testability exports only (no intentional behavior change): Identity output parsers + isWithinGrace/isAlertStatus; sanitizeBody; stripeKeyMode.

Test files added/updated

  • New: scripts/test-deposit-pi-race.js, scripts/test-identity-outputs.js, scripts/test-offboarding-status.js, scripts/test-activity-sanitize-body.js, scripts/test-payments-health-policy.js
  • Updated: package.json scripts; exports in tenant-identity.service.js, activity-audit.service.js, payments-health.service.js

Why these tests materially reduce regression risk

These paths can double-charge deposits, activate leases without collections PII, mis-state move-out progress, leak secrets into the activity log, or silently miss live Stripe webhooks. Deterministic unit tests catch them without DB/Stripe.

Validation

Passed locally (no live DB/Stripe):
npm run test:deposit-pi-race, test:identity-outputs, test:offboarding-status, test:activity-sanitize-body, test:payments-health-policy, plus test:activity-audit and test:identity-crypto.

Note

Please prefer this PR for the gaps above; keep consolidators #49/#50 for their larger suites. Close/supersede overlapping draft coverage PRs once a consolidator merges.

Open in Web View Automation 

cursoragent and others added 5 commits August 17, 2026 10:09
Assert in-flight processing blocks and cancel-vs-succeeded races so
deposit retries cannot double-charge or leave stuck in-progress rows.

Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
Export verified_outputs parsers and assert missing name / redacted SSN
cannot pass collections profile checks after Identity verification.

Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
Lock active detection, completed counts, tenant vs staff step views,
and resolveStepMeta so move-out checklist regressions surface early.

Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
Export sanitizeBody and assert passwords/tokens nest-redact so secrets
cannot leak into the owner activity log.

Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
Export stripeKeyMode and assert live/test detection plus www/bare
webhook URL derivation from CLIENT_ORIGIN.

Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
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