Test Tools

Internal use only — seed / reset test data on the live site

Admin Login

Provisioning
Seed / Reset Test Subscriber

Resets [email protected] to a fresh pending inbox. Run this before each full end-to-end test.

Seed Custom Subscriber

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.

Active test email:[email protected]
End-to-End Test Plan

Full provision → portal → support → teardown cycle

  1. 1.Seed SubscriberResets inbox to pending — always start here
  2. 2.Send Welcome EmailIssues a magic link and emails it — simulates Stripe checkout welcome email
  3. 3.Click magic link in emailOpens /portal directly in wizard, no OTP
  4. 4.Clear Portal DataWipes sessions, OTPs, and tickets for a clean slate
  5. 5.Bypass OTP LoginInjects a session token — then open /portal
  6. 6.Run Provision WizardComplete the wizard at /portal → should reach forwarding_active (or use Set Provisioned shortcut below to skip)
  7. 7.Verify Portal DashboardConfirm inbox status, subscriber info, and wizard completion state display correctly
  8. 8.Seed Test TicketCreates a sample ticket so the Support tab has data
  9. 9.Verify Support TabOpen /portal → Support tab — confirm ticket renders with correct status and priority
  10. 10.Update ticket via /adminChange status and add staff notes — confirm customer-side visibility on reload
  11. 11.Trigger TeardownMoves inbox to pending_teardown; optionally suppress email
  12. 12.FinaliseMarks inbox deprovisioned — verify portal reflects deprovisioned state
  13. 13.Seed Subscriber againReset for the next run
Send Welcome Email (Magic Link)

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.

De-provisioning
Use Set Provisioned to skip the wizard and jump straight to teardown testing. For a full end-to-end run, follow the plan above.
Set Provisioned (shortcut)

Skips the wizard — resets the test inbox directly to forwarding_active so you can test teardown without re-running setup.

Trigger Teardown

Moves the test inbox to pending_teardown and optionally sends the notification email to [email protected].

Finalise (Deprovision)

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.

Reset test inbox

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.

Support Portal
Steps 2–3 and 6–8 of the end-to-end plan above. Use these buttons independently to re-test portal login or support tickets without re-running the full cycle.
Clear Portal Data

Deletes all portal sessions, OTP tokens, and support tickets for [email protected]. Run this first for a clean test.

Bypass OTP Login

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.

Seed Test Ticket

Creates a sample Open / MEDIUM support ticket for the test subscriber. Use this to verify the portal Support tab renders tickets correctly.

Admin

Seed / update admin user

Creates or updates a single admin account with the supplied credentials. Both fields required.

Seed Admin Users

Creates or updates the admin account named above. Requires username and password.

Run Nudges

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.

Back-date Timestamps
Sets a timestamp to N days ago on a subscriber or inbox record so time-gated features can be exercised without waiting. Covers all three time-driven sequences: dunning (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.

Extension Detection Debug

Reads document.documentElement.dataset.ogExtension — the attribute the extension writes at document_start.

Have a question? I can help.