Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
# Live Stripe mock UI test
|
||||
|
||||
Date: 2026-08-04
|
||||
Environment: local Descrybe v2 (`WEB_ORIGIN=http://localhost:5174`, API `:8080`)
|
||||
Demo user: `demo@descrybe.local` / `DemoPass123!` (Local Demo Co)
|
||||
|
||||
## Preconditions
|
||||
|
||||
- `STRIPE_MOCK=true` in root `.env` (API restarted after change)
|
||||
- Migration `016_stripe_billing` applied (goose version 16+)
|
||||
- Web + API running (`localhost:5174`, `localhost:8080/healthz`)
|
||||
- Demo company starts on **Enterprise** (run seed-demo if unsure)
|
||||
|
||||
## Flow exercised
|
||||
|
||||
1. Browser login at `/login`
|
||||
2. Open `/plans` — Enterprise marked **Current plan**; **Upgrade to Starter** visible
|
||||
3. Click **Upgrade to Starter**
|
||||
4. Mock Checkout assigns Starter + credits and redirects to
|
||||
`/billing?checkout=success&mock=1&plan=starter`
|
||||
5. Assert success copy includes **Plan updated** / **starter**; Plan details show **Starter**
|
||||
6. Restore demo: `cd apps/api && go run ./cmd/seed-demo -postgres $env:DATABASE_URL`
|
||||
7. Re-check `/billing` and `/plans` — **Enterprise**, **Unlimited**, no accidental leave on Starter
|
||||
|
||||
## Results
|
||||
|
||||
| Step | Result |
|
||||
|------|--------|
|
||||
| Stripe status (`GET /api/billing/stripe`) | `mock:true`, `configured:false` |
|
||||
| Mock checkout API | `applied:true`, success URL with `mock=1&plan=starter` |
|
||||
| UI Upgrade to Starter | Pass — redirect + success banner |
|
||||
| seed-demo restore Enterprise | Pass — 1,000,000 credits / unlimited SKUs |
|
||||
| Billing after restore | Pass — Enterprise, Unlimited, Compare plans |
|
||||
| Plans after restore | Pass — Current plan on Enterprise; Upgrade CTAs on Starter/Growth/Business |
|
||||
|
||||
Artifacts: `artifacts/live-stripe-checkout.webp`, `artifacts/live-stripe-verify.webp` (+ `.report.json`).
|
||||
|
||||
## UI fixes from this pass
|
||||
|
||||
1. **Plans** — Enterprise subtitle no longer says “with Unlimited AI credits remaining” (redundant/confusing). Copy is now capacity-focused.
|
||||
2. **Billing** — “Compare plans” was an `<a>` wrapping `<button>` (invalid nesting). Switched to `buttonClasses` on the anchor.
|
||||
|
||||
## Notes
|
||||
|
||||
- On Enterprise, Billing hides **Quick upgrade** (by design). Use `/plans` for self-serve mock upgrades.
|
||||
- Mock Checkout on Local Demo Co **will** move the tenant off Enterprise. Always re-run `seed-demo` afterward.
|
||||
- Do **not** leave the demo company on Starter.
|
||||
- **Production:** real `STRIPE_SECRET_KEY`, publishable key, price IDs, and `STRIPE_WEBHOOK_SECRET` are **required** (see [stripe-setup.md](stripe-setup.md)). `STRIPE_MOCK=true` is local-only and is **not** a code blocker for staging as long as prod cutover sets real keys.
|
||||
|
||||
## Restore command
|
||||
|
||||
```powershell
|
||||
cd apps/api
|
||||
# DATABASE_URL from repo `.env` (Postgres :5433)
|
||||
go run ./cmd/seed-demo -postgres $env:DATABASE_URL -email demo@descrybe.local -password 'DemoPass123!' -also-email demo@descrybe.test
|
||||
```
|
||||
|
||||
See also: [stripe-setup.md](stripe-setup.md), [demo-user.md](demo-user.md).
|
||||
Reference in New Issue
Block a user