Test Tools
Internal use only — seed / reset test data on the live site
Admin Login
Resets [email protected] to a fresh pending inbox. Run this before each full end-to-end test.
Seed any email address as a subscriber with a fresh pending inbox — no Stripe checkout required. Once seeded, all portal actions below will use this email.
[email protected]Full provision → portal → support → teardown cycle
- 1.Seed Subscriber — Resets inbox to pending — always start here
- 2.Send Welcome Email — Issues a magic link and emails it — simulates Stripe checkout welcome email
- 3.Click magic link in email — Opens /portal directly in wizard, no OTP
- 4.Clear Portal Data — Wipes sessions, OTPs, and tickets for a clean slate
- 5.Bypass OTP Login — Injects a session token — then open /portal
- 6.Run Provision Wizard — Complete the wizard at /portal → should reach forwarding_active (or use Set Provisioned shortcut below to skip)
- 7.Verify Portal Dashboard — Confirm inbox status, subscriber info, and wizard completion state display correctly
- 8.Seed Test Ticket — Creates a sample ticket so the Support tab has data
- 9.Verify Support Tab — Open /portal → Support tab — confirm ticket renders with correct status and priority
- 10.Update ticket via /admin — Change status and add staff notes — confirm customer-side visibility on reload
- 11.Trigger Teardown — Moves inbox to pending_teardown; optionally suppress email
- 12.Finalise — Marks inbox deprovisioned — verify portal reflects deprovisioned state
- 13.Seed Subscriber again — Reset for the next run
Issues a magic link and emails it to the subscriber — simulates the welcome email sent at Stripe checkout. Leave blank to use the active test email. No inbox row required.
Skips the wizard — resets the test inbox directly to forwarding_active so you can test teardown without re-running setup.
Moves the test inbox to pending_teardown and optionally sends the notification email to [email protected].
Marks the test inbox as deprovisioned. Inbox must be in pending_teardown first.
Without force: expect 409 gateStatus: unevaluable (gate fails closed on NULL last_traffic_at).
With force + no reason: expect 400.
With force + reason: real deletion run.
Resets both systems for the given address: deletes all Forward Email aliases on relay.officeguardfilter.com that forward to it, and resets all matching protected_inboxes rows back to pending. Use before each test cycle to get a clean slate. Email is required — no default.
Deletes all portal sessions, OTP tokens, and support tickets for [email protected]. Run this first for a clean test.
Creates a valid 2-hour portal session for [email protected] and injects the token into sessionStorage. Then open /portal — it will land directly on the dashboard, skipping OTP.
Creates a sample Open / MEDIUM support ticket for the test subscriber. Use this to verify the portal Support tab renders tickets correctly.
Seed / update admin user
Creates or updates a single admin account with the supplied credentials. Both fields required.
Creates or updates the admin account named above. Requires username and password.
Runs ensureDunningColumns migration (first call only), then evaluates all past-due subscribers and fires day-3/7/14/21 dunning actions. Safe to run repeatedly.
past_due_since), stalled-subscriber nudges (licensed_at), and the teardown silence gate (teardown_at).Back-date a timestamp
Sets subscribers.past_due_since. Use days ≥ 3/7/14/21 to trigger each dunning level. Run Nudges after.
Reads document.documentElement.dataset.ogExtension — the attribute the extension writes at document_start.