Skip to content

Commit

Permalink
fix : apply feadback with test cases and htnl structure
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTheKorean committed Oct 26, 2024
1 parent 8b0ba70 commit f5dec9c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/components/leaderboard/index.tsx

This file was deleted.

8 changes: 7 additions & 1 deletion src/components/leaderboard/leaderboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ describe("<Leaderboard/>", () => {
),
);

it("renders the members list section", () => {
expect(
screen.getByRole("region", { name: /members list/i }),
).toBeInTheDocument();
});

it("renders the title", () => {
const heading = screen.getByRole("heading", { level: 1 });
expect(heading).toHaveTextContent("Leaderboard");
Expand All @@ -41,7 +47,7 @@ describe("<Leaderboard/>", () => {
members.forEach((member, index) => {
const memberItem = memberItems[index];
expect(memberItem).toHaveTextContent(`등급: ${member.rank}`);
expect(memberItem).toHaveTextContent(`푼 문제: ${member.solved}`);
expect(memberItem).toHaveTextContent(`진행 상황: ${member.solved}`);
});
});

Expand Down
6 changes: 3 additions & 3 deletions src/components/leaderboard/leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function Leaderboard() {
];

return (
<main>
<div>
<h1>Leaderboard</h1>

<section aria-labelledby="leaderboard">
Expand All @@ -18,7 +18,7 @@ export default function Leaderboard() {
{members.map((member) => (
<li key={member.name} style={{ marginBottom: "20px" }}>
<div>등급: {member.rank}</div>
<div>푼 문제: {member.solved}</div>
<div>진행 상황: {member.solved}</div>
<div>
<a href={`/progress?member=${member.name}`}>
<button>풀이 보기</button>
Expand All @@ -31,6 +31,6 @@ export default function Leaderboard() {
))}
</ul>
</section>
</main>
</div>
);
}

0 comments on commit f5dec9c

Please sign in to comment.