We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 001c29c commit 2b848f6Copy full SHA for 2b848f6
1 file changed
src/components/Page/__tests__/Page.test.js
@@ -7,10 +7,16 @@ import { render, screen } from "@testing-library/react";
7
import { MemoryRouter } from "react-router";
8
import Page from "../Page";
9
10
-// mock components that break tests
+// Mock components that cause unrelated failures
11
jest.mock("../../Contributors/Contributors.jsx", () => () => <div />);
12
jest.mock("../../PageLinks/PageLinks.jsx", () => () => <div />);
13
14
+// Mock react-router hook used inside Page
15
+jest.mock("react-router", () => ({
16
+ ...jest.requireActual("react-router"),
17
+ useLocation: () => ({ pathname: "/test", hash: "" }),
18
+}));
19
+
20
describe("Page component", () => {
21
it("renders error message when content.__error exists", () => {
22
const content = {
0 commit comments