Skip to content

Commit

Permalink
feat : add grade criteria text and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTheKorean committed Jan 21, 2025
1 parent a6a6516 commit 2cee898
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/pages/Leaderboard/Leaderboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@
}
}

.gradeCriteria {
display: flex;
margin-top: 10px;
font-size: 8px;
gap: 3px;
align-items: center;
img {
width: 10px;
height: 10px;
@media (min-width: 1080px) {
width: 16px;
height: 16px;
}
}
@media (min-width: 1080px) {
margin-top: 3px;
font-size: 14px;
}
}

.toolbar {
display: flex;
flex-direction: column;
Expand Down
17 changes: 17 additions & 0 deletions src/pages/Leaderboard/Leaderboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,23 @@ test("render the search bar", () => {
expect(screen.getByLabelText("검색 창"));
});

test("render the grade creteria", () => {
vi.mocked(useMembers).mockReturnValue(
mock({
isLoading: false,
error: null,
members: [mockMember()],
totalCohorts: 0,
filter: { name: "", cohort: null },
setFilter: vi.fn(),
}),
);

render(<Leaderboard />);

expect(screen.getByText(/ /)).toBeInTheDocument();
});

function mockMember() {
const userName = faker.internet.username();
const cohort = faker.number.int({ min: 1, max: 9 });
Expand Down
6 changes: 6 additions & 0 deletions src/pages/Leaderboard/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ export default function Leaderboard() {
/>
</section>

<section className={styles.gradeCriteria}>
<img src="/information-icon.svg"></img>
등급 기준(문제 수) : 나무(70+), 열매(60+), 가지(45+), 잎새(30+),
새싹(15+), 씨앗(0+)
</section>

{error ? (
<div className={styles.serverErrorWrapper}>
<ServerError />
Expand Down

0 comments on commit 2cee898

Please sign in to comment.