Skip to content

Commit e5a0484

Browse files
committed
feat(password): apply backend logic to all password set fields
1 parent c5e5000 commit e5a0484

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

site/src/pages/UserSettingsPage/SecurityPage/SecurityPage.test.tsx

-18
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,6 @@ test("update password with incorrect old password", async () => {
7676
expect(API.updateUserPassword).toBeCalledWith(user.id, newSecurityFormValues);
7777
});
7878

79-
test("update password with invalid password", async () => {
80-
jest.spyOn(API, "updateUserPassword").mockRejectedValueOnce(
81-
mockApiError({
82-
message: "Invalid password.",
83-
validations: [{ detail: "Invalid password.", field: "password" }],
84-
}),
85-
);
86-
87-
const { user } = await renderPage();
88-
fillAndSubmitSecurityForm();
89-
90-
const errorMessage = await screen.findAllByText("Invalid password.");
91-
expect(errorMessage).toBeDefined();
92-
expect(errorMessage).toHaveLength(2);
93-
expect(API.updateUserPassword).toBeCalledTimes(1);
94-
expect(API.updateUserPassword).toBeCalledWith(user.id, newSecurityFormValues);
95-
});
96-
9779
test("update password when submit returns an unknown error", async () => {
9880
jest.spyOn(API, "updateUserPassword").mockRejectedValueOnce({
9981
data: "unknown error",

0 commit comments

Comments
 (0)