Skip to content

Commit

Permalink
Update app_page.t.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hoixw committed Apr 15, 2024
1 parent af54cd7 commit 71dc4b1
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions __tests__/app_page.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,9 @@ describe("IndexPage", () => {
render(<IndexPage />);

await waitFor(() => {
expect(useRouter().push).toHaveBeenCalledWith("/error");
});
});

test("sets loggedIn to true when user is already logged in", async () => {
const mockSupabase = {
auth: {
getUser: jest.fn().mockResolvedValue({ data: { user: { id: 1 } } }),
},
};
createClient.mockReturnValue(mockSupabase);

render(<IndexPage />);

await waitFor(() => {
expect(screen.getByText("Continue to Account")).toBeInTheDocument();
expect(useRouter().push).toHaveBeenCalledWith(
"/error?message=Supabase error",
);
});
});

Expand Down

0 comments on commit 71dc4b1

Please sign in to comment.