feat(chat): render commercial actions and persist greetings

This commit is contained in:
Codex
2026-07-23 14:52:34 +08:00
parent b1f52c68e8
commit 537a0a2c36
26 changed files with 548 additions and 1 deletions
@@ -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"');
});
});