feat(chat): render commercial actions and persist greetings
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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(
|
||||
<CommercialActionCard
|
||||
action={{
|
||||
actionId: "action-1",
|
||||
type: "privateAlbumOffer",
|
||||
copy: "There are more private photos waiting for you.",
|
||||
ctaLabel: "Open private zone",
|
||||
target: "privateZone",
|
||||
ruleId: "private_album_after_appearance_praise",
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
|
||||
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"');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user