import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { SubscriptionCtaButton } from "../subscription-cta-button";
import { SubscriptionPaymentMethod } from "../subscription-payment-method";
import { SubscriptionPaymentSuccessDialog } from "../subscription-payment-success-dialog";
import { StripePaymentDialog } from "../stripe-payment-dialog";
describe("subscription Tailwind components", () => {
it("renders SubscriptionCtaButton with loading state", () => {
const html = renderToStaticMarkup(
Pay now,
);
expect(html).toContain("min-h-[clamp(48px,9.63vw,52px)]");
expect(html).toContain("bg-[linear-gradient(269deg");
expect(html).toContain("animate-spin");
expect(html).toContain("disabled");
expect(html).toContain("Pay now");
});
it("renders SubscriptionPaymentSuccessDialog with topup content", () => {
expect(
renderToStaticMarkup(
undefined}
/>,
),
).toBe("");
const html = renderToStaticMarkup(
undefined}
/>,
);
expect(html).toContain('role="alertdialog"');
expect(html).toContain("z-80");
expect(html).toContain("Payment successful");
expect(html).toContain("Your coins have been added");
expect(html).toContain("bg-[linear-gradient(135deg,#ff67e0_0%,#f657a0_100%)]");
expect(html).toContain("OK");
});
it("renders SubscriptionPaymentMethod with default ordering and selection", () => {
const html = renderToStaticMarkup(
undefined}
/>,
);
expect(html).toContain('aria-labelledby="payment-method-title"');
expect(html).toContain("Payment Method");
expect(html).toContain("GCash by default");
expect(html.indexOf('aria-label="GCash"')).toBeLessThan(
html.indexOf('aria-label="Stripe"'),
);
const selectedButton = html.match(
/