Skip to content

Commit

Permalink
Update reputation points and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdentarikcan committed Dec 15, 2024
1 parent 4742d69 commit 27fb4cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions frontend/src/routes/profile.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ describe("Profile component", () => {
answerCount: 5,
followersCount: 50,
followingCount: 30,
reputationPoints: 75,
bio: "This is John's bio",
country: "US",
},
Expand All @@ -87,6 +88,7 @@ describe("Profile component", () => {
expect(screen.getByText("5")).toBeInTheDocument();
expect(screen.getByText("50")).toBeInTheDocument();
expect(screen.getByText("30")).toBeInTheDocument();
expect(screen.getByText("75")).toBeInTheDocument();
expect(screen.getAllByText("Questions").length).toBeGreaterThan(1);
expect(screen.getAllByText("Answers").length).toBeGreaterThan(1);
});
Expand Down
13 changes: 4 additions & 9 deletions frontend/src/routes/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export default function Profile() {
<div className="font-bold">{profile.followingCount}</div>
<div className="text-sm text-gray-700">Following</div>
</div>
<div>
<div className="font-bold">{profile.reputationPoints}</div>
<div className="text-sm text-gray-700">Reputation Points</div>
</div>
</div>
</div>
<div className="flex items-center justify-between">
Expand Down Expand Up @@ -167,15 +171,6 @@ export default function Profile() {
)
)}
</div>
{profile.reputationPoints && (
<div className="flex flex-col">
<div className="flex flex-wrap gap-2">
<span className="flex items-center gap-2">
<span><strong>Reputation Points:</strong> {profile.reputationPoints}</span>
</span>
</div>
</div>
)}
{profile.followedTags && (
<div className="flex flex-col">
<div className="flex flex-wrap gap-2">
Expand Down

0 comments on commit 27fb4cc

Please sign in to comment.