test: cover playbook insights, CORS allowlists, portal origin, impersonation - #76
Closed
cursor[bot] wants to merge 2 commits into
Closed
cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Move pure builders out of DB-backed playbook service and app.js so rent/utilities insight levels and production CORS canonicalization can be unit-tested without side effects. Export resolvePortalOrigin for email link origin checks. Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
…onation Add deterministic Node suites for manager rent/utilities action levels, LAN/Tailscale CORS matching, production www canonicalization, email portal origin rewrite, and client manager vs owner impersonation gates. Co-authored-by: Jose I. Montero <2eezy77@users.noreply.github.com>
This was referenced Aug 26, 2026
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.
Summary
Focused regression coverage for high-blast-radius helpers still unclaimed vs open drafts #30–#75 (main tip
48f3c2f).Risky behavior now covered
action/ partial→watch/ grace headlines; utilities draft+owed→action; disputed shares→danger; row cap at 8; onboarding incomplete→action100.64–127allowlist; public/malformed/non-http origins rejected (credentialed CORS blast radius)http://host →https://www.; localhost/loopback stay null; allowlist expands bare+www http+https127.0.0.1CLIENT_ORIGINnever ships in outbound pay/maintenance links (rewrites to production www)property_manager→ history-only manager gate; owner/super_admin do not; corrupt session fails closedTest files added/updated
scripts/test-manager-playbook-insights.js+src/services/manager-playbook-insights-pure.jsscripts/test-lan-dev-cors.jsscripts/test-cors-origins.js+src/utils/cors-origins.jsscripts/test-portal-origin.js(exportresolvePortalOrigin)scripts/test-client-impersonation-gates.jspackage.jsonnpm scripts for the aboveWhy this reduces regression risk
These paths drive manager collection urgency, who can CORS into the API on LAN, which origin cookies/emails use in prod, and whether managers see charge UI while previewing tenants. None were covered on main; none were claimed by parallel coverage PRs (#72 Gmail redirect / #71 server impersonation pay guards / #75 email escape utils are different surfaces).
Validation
All passed locally (deterministic Node assert; no DB/Stripe).
Notes