import { describe, test, expect, vi } from "vitest";
import { screen } from "@testing-library/react";
import { renderWithProviders as render } from "../utils/test-utils";
import UseCasesPage from "../../app/(marketing)/use-cases/page";
import messages from "../../messages/en/index";
vi.mock("next/dynamic", () => ({
default: () => {
const Component = vi.fn(() => (
));
return Component;
},
}));
vi.mock("next/link", () => ({
default: ({ children, href, ...props }) => (
{children}
),
}));
describe("UseCasesPage", () => {
const links = messages.pages.useCases.caseStudyTiles.links;
test("renders case study tiles as links to detail pages", () => {
render();
for (const link of links) {
const anchor = screen.getByRole("link", { name: link.ariaLabel });
expect(anchor).toHaveAttribute("href", link.href);
}
});
});