feat(chat): add support action cards and live entitlements
This commit is contained in:
@@ -105,6 +105,30 @@ describe("payment order flow", () => {
|
||||
actor.stop();
|
||||
});
|
||||
|
||||
it("carries the originating chat action into order creation", async () => {
|
||||
const createOrderSpy = vi.fn<CreateOrderSpy>();
|
||||
const actor = createActor(
|
||||
createTestPaymentMachine({ createOrderSpy }),
|
||||
).start();
|
||||
actor.send({
|
||||
type: "PaymentInit",
|
||||
planId: "vip_monthly",
|
||||
chatActionId: "019c8f8d-17d3-7a42-b1cc-b6927b1927d5",
|
||||
});
|
||||
await waitFor(actor, (snapshot) => snapshot.matches("ready"));
|
||||
|
||||
actor.send({ type: "PaymentCreateOrderSubmitted" });
|
||||
await waitFor(actor, (snapshot) => snapshot.matches("paid"));
|
||||
|
||||
expect(createOrderSpy).toHaveBeenCalledWith({
|
||||
planId: "vip_monthly",
|
||||
payChannel: "stripe",
|
||||
autoRenew: true,
|
||||
chatActionId: "019c8f8d-17d3-7a42-b1cc-b6927b1927d5",
|
||||
});
|
||||
actor.stop();
|
||||
});
|
||||
|
||||
it("loads a stable Tip message after payment and clears it on reset", async () => {
|
||||
const loadTipMessage = vi.fn();
|
||||
const actor = createActor(
|
||||
|
||||
Reference in New Issue
Block a user