Skip to content

Commit

Permalink
Update profile test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolelim02 committed Sep 29, 2024
1 parent ce30232 commit 72487f9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frontend/src/components/ProfileSection/ProfileSection.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("Profile section", () => {
isCurrentUser={isCurrentUser}
handleEditProfileOpen={handleEditProfileOpen}
handleChangePasswordOpen={handleChangePasswordOpen}
/>,
/>
);
expect(screen.getByText(`${firstName} ${lastName}`)).toBeInTheDocument();
});
Expand All @@ -46,7 +46,7 @@ describe("Profile section", () => {
isCurrentUser={isCurrentUser}
handleEditProfileOpen={handleEditProfileOpen}
handleChangePasswordOpen={handleChangePasswordOpen}
/>,
/>
);
expect(screen.getByText(`@${username}`)).toBeInTheDocument();
});
Expand All @@ -70,15 +70,15 @@ describe("Profiles that don't belong to the current authenticated user", () => {
isCurrentUser={isCurrentUser}
handleEditProfileOpen={handleEditProfileOpen}
handleChangePasswordOpen={handleChangePasswordOpen}
/>,
/>
);
const editProfileButton = screen.queryByRole("button", {
name: "Edit profile",
});
expect(editProfileButton).not.toBeInTheDocument();
});

it("Edit password button is absent", () => {
it("Change password button is absent", () => {
const firstName = faker.person.firstName();
const lastName = faker.person.lastName();
const username = faker.internet.userName();
Expand All @@ -95,10 +95,10 @@ describe("Profiles that don't belong to the current authenticated user", () => {
isCurrentUser={isCurrentUser}
handleEditProfileOpen={handleEditProfileOpen}
handleChangePasswordOpen={handleChangePasswordOpen}
/>,
/>
);
const editProfileButton = screen.queryByRole("button", {
name: "Edit password",
name: "Change password",
});
expect(editProfileButton).not.toBeInTheDocument();
});
Expand All @@ -122,15 +122,15 @@ describe("Profiles that belong to the current authenticated user", () => {
isCurrentUser={isCurrentUser}
handleEditProfileOpen={handleEditProfileOpen}
handleChangePasswordOpen={handleChangePasswordOpen}
/>,
/>
);
const editProfileButton = screen.queryByRole("button", {
name: "Edit profile",
});
expect(editProfileButton).toBeInTheDocument();
});

it("Edit password button is present", () => {
it("Change password button is present", () => {
const firstName = faker.person.firstName();
const lastName = faker.person.lastName();
const username = faker.internet.userName();
Expand All @@ -147,7 +147,7 @@ describe("Profiles that belong to the current authenticated user", () => {
isCurrentUser={isCurrentUser}
handleEditProfileOpen={handleEditProfileOpen}
handleChangePasswordOpen={handleChangePasswordOpen}
/>,
/>
);
const editProfileButton = screen.getByRole("button", {
name: "Change password",
Expand Down

0 comments on commit 72487f9

Please sign in to comment.