fix(payment): resume QRIS after closing dialog
This commit is contained in:
@@ -266,6 +266,39 @@ test("Indonesia credit top-up uses QRIS display cents", async ({ page }) => {
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
test("closing QRIS restores a resumable checkout without creating a duplicate order", async ({
|
||||
page,
|
||||
}) => {
|
||||
const payment = await registerIndonesiaPaymentMocks(page);
|
||||
await prepareIndonesiaUser(page);
|
||||
await page.goto("/subscription?type=topup&character=elio");
|
||||
|
||||
const orderId = await expectQrisOrder(
|
||||
page,
|
||||
/Pay and Top Up/i,
|
||||
"dol_1000",
|
||||
/Rp\s*88[.,]900/,
|
||||
);
|
||||
const dialog = page.getByRole("dialog", { name: "Scan to pay with QRIS" });
|
||||
await dialog.getByRole("button", { name: "Close" }).click();
|
||||
|
||||
await expect(dialog).toBeHidden();
|
||||
const resumeButton = page.getByRole("button", {
|
||||
name: "Resume QRIS payment",
|
||||
});
|
||||
await expect(resumeButton).toBeEnabled();
|
||||
expect(payment.getCreateOrderCount()).toBe(1);
|
||||
|
||||
await resumeButton.click();
|
||||
await expect(dialog).toBeVisible();
|
||||
expect(payment.getCreateOrderCount()).toBe(1);
|
||||
|
||||
payment.markPaid(orderId);
|
||||
await expect(
|
||||
page.getByRole("alertdialog", { name: "Payment successful" }),
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
test("payment issue submits Other to the feedback API without creating an order", async ({
|
||||
page,
|
||||
}) => {
|
||||
@@ -323,6 +356,18 @@ test("Indonesia gift checkout keeps IDR price through QRIS and thank-you flow",
|
||||
"tip_coffee_usd_4_99",
|
||||
/Rp\s*89[.,]299/,
|
||||
);
|
||||
const dialog = page.getByRole("dialog", { name: "Scan to pay with QRIS" });
|
||||
await dialog.getByRole("button", { name: "Close" }).click();
|
||||
await expect(dialog).toBeHidden();
|
||||
|
||||
const resumeButton = page.getByRole("button", {
|
||||
name: "Resume QRIS payment",
|
||||
});
|
||||
await expect(resumeButton).toBeEnabled();
|
||||
await resumeButton.click();
|
||||
await expect(dialog).toBeVisible();
|
||||
expect(payment.getCreateOrderCount()).toBe(1);
|
||||
|
||||
payment.markPaid(orderId);
|
||||
|
||||
await expect(page.getByText("Gift received")).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
Reference in New Issue
Block a user