Skip to content

Commit

Permalink
test: render test leaderboard link
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunjae95 committed Dec 26, 2024
1 parent 305f9b6 commit b653ec7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/pages/Certificate/Certificate.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,27 @@ test("render content solved problems, cohort", () => {
});
});

test("render learderboard link", () => {
vi.mocked(useMembers).mockReturnValue(
mock({
isLoading: false,
error: null,
members: [mock<Member>({ id: "test1", name: "테스트1" })],
totalCohorts: 0,
filter: { name: "", cohort: null },
setFilter: vi.fn(),
}),
);

location.href = new URL(`?member=test1`, location.href).toString();
render(<Certificate />);

const leaderboardLink = screen.getByRole("link", {
name: "리더보드로 돌아가기",
});
expect(leaderboardLink).toHaveAttribute("href", `/`);
});

test("render print button", () => {
vi.mocked(useMembers).mockReturnValue(
mock({
Expand Down

0 comments on commit b653ec7

Please sign in to comment.