www/__tests__/app/blog/[...slug]/page.test.jsx
Xe Iaso 993254f389
enable testing
Signed-off-by: Xe Iaso <me@xeiaso.net>
2024-09-23 09:58:08 -07:00

24 lines
657 B
JavaScript

import "@testing-library/jest-dom";
import { render, screen } from "@testing-library/react";
import BlogPage from "@/app/blog/[...slug]/page";
import { describe, expect, test, it } from "@jest/globals";
import { allPosts } from "@/.content-collections/generated";
test.each(allPosts)("BlogPage $slug", (p) => {
render(<BlogPage params={{ slug: p._meta.path.split("/") }} />);
it("properly renders the title", () => {
const heading = screen.getByRole("heading", {
level: 1,
name: p.title,
});
expect(heading)
//@ts-ignore
.toBeInTheDocument();
});
});
describe("placeholder", () => {
it("works", () => { });
})