test: cover password-reset, invite helpers, property access, ledger months - #74
Closed
cursor[bot] wants to merge 5 commits into
Closed
cursor[bot] wants to merge 5 commits into
cursor[bot] wants to merge 5 commits into
Conversation
Export pure helpers used by completePasswordReset so short/used/expired links stay fail-closed without needing a live DB. Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
Assert invite reset URLs keep the lease next path and hash tokens the same way as forgot-password. Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
Mocked pool checks owner/org vs assignment scoping and tenant-only maintenance visibility. Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
Archived former-tenant successes must not supersede live failed rows; month keys follow period_start → due_date → paid_at. Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
Add test:password-reset-token, test:tenant-invite-helpers, test:property-access, and test:payment-ledger-month. Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Risky behavior now covered
completePasswordResetstays fail-closed.next=/tenant/lease, and shared token hashing with forgot-password (so invite tokens redeem on the same path).billingMonthKeyfallbacks; archived former-tenant successes must not supersede live failed rows (Davontaye / site-archive policy).Test files added/updated
scripts/test-password-reset-token.js(+ exports inpassword-reset.service.js)scripts/test-tenant-invite-helpers.js(+ exports intenant-invite.service.js)scripts/test-property-access.jsscripts/test-payment-ledger-month.jspackage.jsonscripts:test:password-reset-token,test:tenant-invite-helpers,test:property-access,test:payment-ledger-monthWhy these tests materially reduce regression risk
These paths are high blast-radius (auth recovery, lease onboarding invites, staff/tenant data scoping, former-tenant ledger hiding) and were unclaimed by open coverage drafts #66–#73. Suites are deterministic Node asserts with a mocked DB for access checks—no Stripe/DB flakiness.
Validation
All passed locally.
Note
Tiny testability extracts only (export pure helpers / use them in existing control flow). No production behavior change beyond equivalent validity checks.