import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { CommercialActionCard } from "../commercial-action-card";
describe("CommercialActionCard", () => {
it("renders a private-zone offer with a usable CTA", () => {
const html = renderToStaticMarkup(
,
);
expect(html).toContain('data-commercial-action="privateAlbumOffer"');
expect(html).toContain("There are more private photos waiting for you.");
expect(html).toContain("Open private zone");
expect(html).toContain('aria-label="Dismiss offer"');
});
it("renders a consent-first discount action without a checkout URL", () => {
const html = renderToStaticMarkup(
,
);
expect(html).toContain('data-commercial-action="discountOffer"');
expect(html).toContain("Yes, ask for me");
expect(html).not.toContain("/subscription");
});
});