From 3d4a5e1468f4480ed035528e0da3f7f9c8efb7bf Mon Sep 17 00:00:00 2001 From: Brok3Turtl3 Date: Fri, 29 Mar 2024 08:07:35 -0400 Subject: [PATCH] CHE-7 Updated Banner button test for editProfile routing --- client/src/components/Banner/Banner.test.tsx | 4 ++-- client/src/pages/Profiles/Profiles.tsx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/components/Banner/Banner.test.tsx b/client/src/components/Banner/Banner.test.tsx index da3da40..7d7e4dd 100644 --- a/client/src/components/Banner/Banner.test.tsx +++ b/client/src/components/Banner/Banner.test.tsx @@ -74,10 +74,10 @@ describe("Banner Component", () => { const optionsButton = screen.getByRole("button", { name: "Options" }); fireEvent.click(optionsButton); - const profileOption = screen.getByText("Go to Profile"); + const profileOption = screen.getByText("Edit Profile"); fireEvent.click(profileOption); - expect(mockNavigate).toHaveBeenCalledWith("profile"); + expect(mockNavigate).toHaveBeenCalledWith("editProfile"); }); it("handles logout on clicking Logout", () => { diff --git a/client/src/pages/Profiles/Profiles.tsx b/client/src/pages/Profiles/Profiles.tsx index 916dae4..9795e37 100644 --- a/client/src/pages/Profiles/Profiles.tsx +++ b/client/src/pages/Profiles/Profiles.tsx @@ -17,8 +17,9 @@ const Profiles = (): JSX.Element => {

PROFILES

- {profiles.map((profile) => ( - + {/* TODO Look at better key for this */} + {profiles.map((profile, index) => ( + ))}