feat(payment): confirm renewal only at checkout
Docker Image / Build and Push Docker Image (push) Successful in 2m9s

This commit is contained in:
Codex
2026-07-29 11:26:42 +08:00
parent 3536045794
commit e071f83474
15 changed files with 492 additions and 240 deletions
@@ -74,16 +74,17 @@ test("offers the Facebook external-browser path before creating a Stripe order",
});
await seedEmailSession(page);
await page.goto("/subscription?type=vip&payChannel=stripe");
await page.goto(
"/subscription?type=vip&payChannel=stripe&character=elio",
);
await page.getByRole("button", { name: /Monthly,/i }).click();
await page
.getByRole("dialog", { name: "Automatic Renewal Confirmation" })
.getByRole("button", { name: "Confirm" })
.click();
const externalButton = page.getByRole("button", {
name: "Open in browser for more payment methods",
});
await expect(externalButton).toBeVisible();
await expect(externalButton).toBeEnabled();
await expect(
page.getByRole("dialog", { name: "Automatic Renewal Confirmation" }),
).toHaveCount(0);
const handoffRequest = page.waitForRequest("**/api/auth/handoff/checkout");
await externalButton.click();
expect((await handoffRequest).postDataJSON()).toMatchObject({