import { renderToStaticMarkup } from "react-dom/server"; import { describe, expect, it, vi } from "vitest"; import { PaymentLaunchDialogs } from "../payment-launch-dialogs"; const hiddenLaunch = { handleEzpayCancel: vi.fn(), handleEzpayConfirm: vi.fn(), handleStripeClose: vi.fn(), handleStripeConfirmed: vi.fn(), isConfirmingEzpay: false, shouldShowEzpayConfirmDialog: false, shouldShowStripeDialog: false, stripeClientSecret: null, }; describe("PaymentLaunchDialogs", () => { it("renders nothing when neither payment dialog is active", () => { expect( renderToStaticMarkup( , ), ).toBe(""); }); it("renders the shared Ezpay confirmation content", () => { const html = renderToStaticMarkup( , ); expect(html).toContain('role="alertdialog"'); expect(html).toContain("Continue to GCash?"); expect(html).toContain("Your coffee order is ready."); expect(html).toContain("Order No. order-123"); expect(html).toContain('data-analytics-key="tip.external_checkout"'); expect(html).toContain("Opening..."); }); });