Skip to content

Commit adb23d6

Browse files
committed
update profilesection test according to frontend modal changes
1 parent ead9856 commit adb23d6

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

frontend/src/components/ProfileSection/ProfileSection.test.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ describe("Profile section", () => {
1313
const username = faker.internet.userName();
1414
const biography = faker.person.bio();
1515
const isCurrentUser = false;
16-
const userId = faker.string.nanoid();
17-
const onUpdate = jest.fn();
16+
const handleEditProfileOpen = jest.fn();
17+
const handleChangePasswordOpen = jest.fn();
1818
render(
1919
<ProfileSection
2020
firstName={firstName}
2121
lastName={lastName}
2222
username={username}
2323
biography={biography}
2424
isCurrentUser={isCurrentUser}
25-
userId={userId}
26-
onUpdate={onUpdate}
25+
handleEditProfileOpen={handleEditProfileOpen}
26+
handleChangePasswordOpen={handleChangePasswordOpen}
2727
/>
2828
);
2929
expect(screen.getByText(`${firstName} ${lastName}`)).toBeInTheDocument();
@@ -35,17 +35,17 @@ describe("Profile section", () => {
3535
const username = faker.internet.userName();
3636
const biography = faker.person.bio();
3737
const isCurrentUser = false;
38-
const userId = faker.string.nanoid();
39-
const onUpdate = jest.fn();
38+
const handleEditProfileOpen = jest.fn();
39+
const handleChangePasswordOpen = jest.fn();
4040
render(
4141
<ProfileSection
4242
firstName={firstName}
4343
lastName={lastName}
4444
username={username}
4545
biography={biography}
4646
isCurrentUser={isCurrentUser}
47-
userId={userId}
48-
onUpdate={onUpdate}
47+
handleEditProfileOpen={handleEditProfileOpen}
48+
handleChangePasswordOpen={handleChangePasswordOpen}
4949
/>
5050
);
5151
expect(screen.getByText(`@${username}`)).toBeInTheDocument();
@@ -59,17 +59,17 @@ describe("Profiles that don't belong to the current authenticated user", () => {
5959
const username = faker.internet.userName();
6060
const biography = faker.person.bio();
6161
const isCurrentUser = false;
62-
const userId = faker.string.nanoid();
63-
const onUpdate = jest.fn();
62+
const handleEditProfileOpen = jest.fn();
63+
const handleChangePasswordOpen = jest.fn();
6464
render(
6565
<ProfileSection
6666
firstName={firstName}
6767
lastName={lastName}
6868
username={username}
6969
biography={biography}
7070
isCurrentUser={isCurrentUser}
71-
userId={userId}
72-
onUpdate={onUpdate}
71+
handleEditProfileOpen={handleEditProfileOpen}
72+
handleChangePasswordOpen={handleChangePasswordOpen}
7373
/>
7474
);
7575
const editProfileButton = screen.queryByRole("button", {
@@ -84,17 +84,17 @@ describe("Profiles that don't belong to the current authenticated user", () => {
8484
const username = faker.internet.userName();
8585
const biography = faker.person.bio();
8686
const isCurrentUser = false;
87-
const userId = faker.string.nanoid();
88-
const onUpdate = jest.fn();
87+
const handleEditProfileOpen = jest.fn();
88+
const handleChangePasswordOpen = jest.fn();
8989
render(
9090
<ProfileSection
9191
firstName={firstName}
9292
lastName={lastName}
9393
username={username}
9494
biography={biography}
9595
isCurrentUser={isCurrentUser}
96-
userId={userId}
97-
onUpdate={onUpdate}
96+
handleEditProfileOpen={handleEditProfileOpen}
97+
handleChangePasswordOpen={handleChangePasswordOpen}
9898
/>
9999
);
100100
const editProfileButton = screen.queryByRole("button", {
@@ -111,17 +111,17 @@ describe("Profiles that belong to the current authenticated user", () => {
111111
const username = faker.internet.userName();
112112
const biography = faker.person.bio();
113113
const isCurrentUser = true;
114-
const userId = faker.string.nanoid();
115-
const onUpdate = jest.fn();
114+
const handleEditProfileOpen = jest.fn();
115+
const handleChangePasswordOpen = jest.fn();
116116
render(
117117
<ProfileSection
118118
firstName={firstName}
119119
lastName={lastName}
120120
username={username}
121121
biography={biography}
122122
isCurrentUser={isCurrentUser}
123-
userId={userId}
124-
onUpdate={onUpdate}
123+
handleEditProfileOpen={handleEditProfileOpen}
124+
handleChangePasswordOpen={handleChangePasswordOpen}
125125
/>
126126
);
127127
const editProfileButton = screen.queryByRole("button", {
@@ -136,17 +136,17 @@ describe("Profiles that belong to the current authenticated user", () => {
136136
const username = faker.internet.userName();
137137
const biography = faker.person.bio();
138138
const isCurrentUser = true;
139-
const userId = faker.string.nanoid();
140-
const onUpdate = jest.fn();
139+
const handleEditProfileOpen = jest.fn();
140+
const handleChangePasswordOpen = jest.fn();
141141
render(
142142
<ProfileSection
143143
firstName={firstName}
144144
lastName={lastName}
145145
username={username}
146146
biography={biography}
147147
isCurrentUser={isCurrentUser}
148-
userId={userId}
149-
onUpdate={onUpdate}
148+
handleEditProfileOpen={handleEditProfileOpen}
149+
handleChangePasswordOpen={handleChangePasswordOpen}
150150
/>
151151
);
152152
const editProfileButton = screen.queryByRole("button", {

0 commit comments

Comments
 (0)