#jonah-checkout-testclock
1 messages · Page 1 of 1 (latest)
jonah-checkout-testclock
Hey @nocturne bear, Checkout doesn't directly support test clocks.
you can't, that's what I meant
I've got a UI integration test that I want to fast forward.... okay haha any hack or anything you can think of?
No that's mostly impossible. You can use TestClock outside of Checkout
But really you shouldn't be writing tests like this that interact with Checkout
Okay, so maybe I've done something stupid with the architecture.
I have 2 type of tests: CLI and UI.
My CLI creates subscriptions using Subscription.create, whereas my UI uses a checkout.
yeah I understand, but really you should mock all of Stripe entirely in your test
not hit our API over and over for your tests
Also we could change the Checkout UI at any time and break your tests
You would mock Stripe entirely, never hit Stripe, never open Checkout, etc. You simulate Checkout happening for example by having a stub/mock of what a Checkout Session/Customer/Subscription looks like before/after payment
Not sure how that would test the webhooks
Still need to make sure those are tested, no?
Your webhook is an endpoint you can hit in your test with fixtures/mocked data
Okay fair, thanks.
What about including a coupon id in a checkout session? I didn't see this in the docs