Skip to content

060 — should cancel monthly subscription and revoke access after period ends

Description

Verifies the cancel-then-period-end behaviour for a Monthly subscription: cancellation keeps access active until the period ends, then once the cycle is over the plan goes inactive, the convert-to-paid banner returns, and every user is downgraded to "View only".

Preconditions

  • Freshly registered tenant signed in as the owner on the dev environment.
  • Tenant is on the 14-day free trial.
  • Stripe sandbox customer + test clock exist for the tenant.

Steps

  1. Open the Billing page. Expected: 14-day trial summary visible.
  2. Buy the Monthly plan via Hosted Checkout (1 seat). Expected: Monthly active, 1 seat at $16.00, 1 of 1 used, summary and next-payment date match Stripe.
  3. Open the Customer Portal and grow Monthly to 2 seats. Add 1 employee via API and reload Billing. Expected: Monthly subscription shows 2 seats at $32.00, 2 of 2 used, summary and next-payment date match Stripe.
  4. Open the Customer Portal again and cancel the Monthly subscription, then return to the app. Expected: Monthly subscription still shows 2 seats and 2 of 2 used, but the summary sentence now reads "subscription ends ..." with a date matching Stripe's period end, and the displayed cost drops to $16.00 (the original first-invoice amount, since the upgrade to 2 seats was prorated).
  5. Advance the Stripe test clock by 32 days and reload. Expected: the convert-to-paid prompt and banner are back at the top of the Billing page, the Monthly card shows a "Renew Monthly subscription" action.
  6. Open the Users page. Expected: the owner and the previously-added employee are both shown as "View only" with no access, and the convert-to-paid prompt/banner is still visible.
  • Spec: playwright/tests/integration/billing.spec.ts (line 335)
  • Spec: playwright/tests/integration/billing.spec.ts (line 335)