mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-18 21:44:06 +01:00
31 lines
866 B
TypeScript
31 lines
866 B
TypeScript
import { render } from "@testing-library/react";
|
|
|
|
// Error and Loading Pages
|
|
import Error from "@/app/error";
|
|
import Loading from "@/app/loading";
|
|
import NotFound from "@/app/not-found";
|
|
|
|
import { mockError, mockReset } from "./utils";
|
|
|
|
// Mock Cookies
|
|
jest.mock("next/headers", () => ({
|
|
cookies: jest.fn(() => ({
|
|
getAll: jest.fn(() => [{ name: "test", value: "cookieValue" }]), // Simulate returning cookies
|
|
setAll: jest.fn(), // Simulate setAll method
|
|
})),
|
|
}));
|
|
|
|
// Error and Loading Pages
|
|
describe("Error and Loading Pages", () => {
|
|
it("Error Page should render without crashing", () => {
|
|
render(<Error error={mockError} reset={mockReset} />);
|
|
});
|
|
|
|
it("Loading Page should render without crashing", () => {
|
|
render(Loading());
|
|
});
|
|
|
|
it("Not Found Page should render without crashing", () => {
|
|
render(NotFound());
|
|
});
|
|
}); |