9deb320cf6
Rename the global Sidebar route, UI, assets, analytics, and payment return context to Profile. Add accessible message-avatar navigation and preserve the source character across auth and logout flows. BREAKING CHANGE: /sidebar has been removed; use /profile instead.
56 lines
2.1 KiB
TypeScript
56 lines
2.1 KiB
TypeScript
import { renderToStaticMarkup } from "react-dom/server";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import { SplashBackground } from "../splash-background";
|
|
import { SplashButton } from "../splash-button";
|
|
import { SplashContent } from "../splash-content";
|
|
import { SplashLogo } from "../splash-logo";
|
|
|
|
describe("splash Tailwind components", () => {
|
|
it("renders SplashLogo with Tailwind wrapper and image classes", () => {
|
|
const html = renderToStaticMarkup(<SplashLogo />);
|
|
|
|
expect(html).toContain("z-2");
|
|
expect(html).toContain("inline-flex");
|
|
expect(html).toContain("block h-auto w-auto");
|
|
expect(html).toContain("%2Fimages%2Fsplash%2Fic-logo-home.png");
|
|
});
|
|
|
|
it("renders SplashBackground with Tailwind fill image classes", () => {
|
|
const html = renderToStaticMarkup(
|
|
<SplashBackground src="/images/cover/maya.png" />,
|
|
);
|
|
|
|
expect(html).toContain("absolute");
|
|
expect(html).toContain("bg-splash-background");
|
|
expect(html).toContain("object-cover");
|
|
expect(html).toContain("%2Fimages%2Fcover%2Fmaya.png");
|
|
});
|
|
|
|
it("renders SplashContent with Tailwind typography classes", () => {
|
|
const html = renderToStaticMarkup(<SplashContent characterName="Maya" />);
|
|
|
|
expect(html).toContain("flex flex-col gap-md");
|
|
expect(html).toContain("font-(family-name:--font-athelas)");
|
|
expect(html).toContain("whitespace-pre-line");
|
|
expect(html).toContain("Welcome to Maya");
|
|
});
|
|
|
|
it("renders SplashButton as an always-ready action", () => {
|
|
const html = renderToStaticMarkup(
|
|
<SplashButton onStartChat={() => undefined} />,
|
|
);
|
|
|
|
expect(html).toContain("z-2");
|
|
expect(html).toContain("max-w-120");
|
|
expect(html).toContain("bg-[linear-gradient(to_right");
|
|
expect(html).toContain("active:enabled:scale-96");
|
|
expect(html).toContain("active:enabled:brightness-90");
|
|
expect(html).toContain("touch-manipulation");
|
|
expect(html).toContain("Start Chatting");
|
|
expect(html).toContain('data-analytics-key="splash.start_chat"');
|
|
expect(html).not.toContain("disabled=\"");
|
|
expect(html).not.toContain("animate-spin");
|
|
});
|
|
});
|