Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo-battista committed Oct 25, 2023
1 parent a3857d6 commit 5793855
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/Sidebar/ProjectSidebar/ProjectSidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@
import { render } from "@testing-library/react";
import { ProjectSidebar } from "@/components/Sidebar/ProjectSidebar/index";

const useRouter = jest.spyOn(require("next/router"), "useRouter");

describe("ProjectSidebar", () => {
test("should render", () => {
useRouter.mockImplementationOnce(() => ({
query: { project: "test-project" },
}));
const { getByText } = render(<ProjectSidebar />);
expect(getByText("Dashboard")).toBeInTheDocument();
expect(getByText("Return to Dashboard")).toBeInTheDocument();
expect(getByText("Arke")).toBeInTheDocument();
expect(getByText("Parameters")).toBeInTheDocument();
expect(getByText("Users")).toBeInTheDocument();
expect(getByText("Members")).toBeInTheDocument();
expect(getByText("Logout")).toBeInTheDocument();
});
});
3 changes: 3 additions & 0 deletions components/Sidebar/Sidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ describe("Sidebar", () => {
test("should render", () => {
const { getByText } = render(<Sidebar />);
expect(getByText("Dashboard")).toBeInTheDocument();
expect(getByText("Guide")).toBeInTheDocument();
expect(getByText("Report a problem")).toBeInTheDocument();
expect(getByText("Support chat")).toBeInTheDocument();
});
});

0 comments on commit 5793855

Please sign in to comment.