Skip to content

Commit

Permalink
CHE-7 Updated Banner button test for editProfile routing
Browse files Browse the repository at this point in the history
  • Loading branch information
brok3turtl3 committed Mar 29, 2024
1 parent 09877fd commit 3d4a5e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/src/components/Banner/Banner.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/Profiles/Profiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ const Profiles = (): JSX.Element => {
<h1 className="text-4xl font-extrabold mb-4">PROFILES</h1>
</div>
<div>
{profiles.map((profile) => (
<ProfileThumb key={profile._id} profile={profile} />
{/* TODO Look at better key for this */}
{profiles.map((profile, index) => (
<ProfileThumb key={index} profile={profile} />
))}
</div>
</>
Expand Down

0 comments on commit 3d4a5e1

Please sign in to comment.