Skip to content

Commit 3fda99d

Browse files
fix: fix tests to reflect state of dashboard
1 parent 14d3e6f commit 3fda99d

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/app/dashboard/__tests__/page.test.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ vi.mock("next/navigation", () => ({
88
redirect: vi.fn(),
99
}));
1010

11+
// Mock next/font/google
12+
vi.mock("next/font/google", () => ({
13+
Cinzel: () => ({
14+
className: "mocked-cinzel-font",
15+
}),
16+
}));
17+
1118
// Mock Supabase server client to return a fake authenticated user
1219
vi.mock("../../../lib/supabase/server", () => ({
1320
createClient: vi.fn(async () => ({
@@ -36,16 +43,10 @@ describe("Dashboard Page Tests", () => {
3643
expect(screen.getByText("Dashboard")).toBeInTheDocument();
3744
});
3845

39-
it("should display the user email", async () => {
40-
const page = await DashboardPage();
41-
render(page);
42-
expect(screen.getByText("[email protected]")).toBeInTheDocument();
43-
});
44-
4546
it("should render the home link", async () => {
4647
const page = await DashboardPage();
4748
render(page);
48-
expect(screen.getByRole("link", { name: /Go home/i })).toBeInTheDocument();
49+
expect(screen.getByRole("link", { name: /Home/i })).toBeInTheDocument();
4950
});
5051

5152
it("should render the logout button", async () => {
@@ -57,6 +58,12 @@ describe("Dashboard Page Tests", () => {
5758
it("should render the tutorial link", async () => {
5859
const page = await DashboardPage();
5960
render(page);
60-
expect(screen.getByRole("link", { name: /Hello World Tutorial/i })).toBeInTheDocument();
61+
expect(screen.getByRole("link", { name: /Hello World/i })).toBeInTheDocument();
62+
});
63+
64+
it("should render the profile button", async () => {
65+
const page = await DashboardPage();
66+
render(page);
67+
expect(screen.getByRole("link", { name: /Profile/i })).toBeInTheDocument();
6168
});
6269
});

0 commit comments

Comments
 (0)