import type { ReactNode } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it, vi } from "vitest";
import SectionItemCard from "./SectionItemCard";
vi.mock("@/components/ViewTransitionLink", () => ({
default: ({ children }: { children: ReactNode }) =>
{children}
,
}));
vi.mock("@/components/MediaItemMenu", () => ({
default: () => null,
}));
vi.mock("@/components/overlays/CardOverlays", () => ({
default: () => null,
}));
vi.mock("@/hooks/useOverlayPrefs", () => ({
useOverlayPrefs: () => ({ prefs: null }),
}));
describe("SectionItemCard", () => {
it("renders premiere metadata when an upcoming event is present", () => {
const markup = renderToStaticMarkup(
,
);
expect(markup).toContain("Series A");
expect(markup).toContain("Season Premiere");
expect(markup).toContain("Season 2 ยท Back Again");
expect(markup).toContain("Wed, Apr 8");
expect(markup).toContain("8:00 PM");
});
});