From 4742d696181ea230b37c8d03e0048e1dd2c18aee Mon Sep 17 00:00:00 2001 From: ozdentarikcan Date: Thu, 12 Dec 2024 22:26:53 +0300 Subject: [PATCH 1/2] Add reputation points to profile page --- frontend/src/routes/profile.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/routes/profile.tsx b/frontend/src/routes/profile.tsx index 13ef94f6..7e836162 100644 --- a/frontend/src/routes/profile.tsx +++ b/frontend/src/routes/profile.tsx @@ -167,6 +167,15 @@ export default function Profile() { ) )} + {profile.reputationPoints && ( +
+
+ + Reputation Points: {profile.reputationPoints} + +
+
+ )} {profile.followedTags && (
From 27fb4cc06d462182b16a0836f5da6f4d61688838 Mon Sep 17 00:00:00 2001 From: ozdentarikcan Date: Sun, 15 Dec 2024 16:52:58 +0300 Subject: [PATCH 2/2] Update reputation points and add test --- frontend/src/routes/profile.test.tsx | 2 ++ frontend/src/routes/profile.tsx | 13 ++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/frontend/src/routes/profile.test.tsx b/frontend/src/routes/profile.test.tsx index fc76cadc..350869bb 100644 --- a/frontend/src/routes/profile.test.tsx +++ b/frontend/src/routes/profile.test.tsx @@ -66,6 +66,7 @@ describe("Profile component", () => { answerCount: 5, followersCount: 50, followingCount: 30, + reputationPoints: 75, bio: "This is John's bio", country: "US", }, @@ -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); }); diff --git a/frontend/src/routes/profile.tsx b/frontend/src/routes/profile.tsx index 7e836162..ea9b9af2 100644 --- a/frontend/src/routes/profile.tsx +++ b/frontend/src/routes/profile.tsx @@ -100,6 +100,10 @@ export default function Profile() {
{profile.followingCount}
Following
+
+
{profile.reputationPoints}
+
Reputation Points
+
@@ -167,15 +171,6 @@ export default function Profile() { ) )}
- {profile.reputationPoints && ( -
-
- - Reputation Points: {profile.reputationPoints} - -
-
- )} {profile.followedTags && (