Skip to content

Commit ef18333

Browse files
committed
Fix test
1 parent fed5e00 commit ef18333

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

site/src/pages/ResetPasswordPage/ChangePasswordPage.stories.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ export const GeneralServerError: Story = {
7474

7575
export const ValidationServerError: Story = {
7676
play: async ({ canvasElement }) => {
77+
const validationDetail =
78+
"insecure password, try including more special characters, using uppercase letters, using numbers or using a longer password";
7779
const error = mockApiError({
7880
message: "Invalid password.",
7981
validations: [
8082
{
8183
field: "password",
82-
detail:
83-
"insecure password, try including more special characters, using uppercase letters, using numbers or using a longer password",
84+
detail: validationDetail,
8485
},
8586
],
8687
});
@@ -93,6 +94,6 @@ export const ValidationServerError: Story = {
9394
await canvas.findByLabelText("Confirm password *");
9495
await user.type(confirmPasswordInput, "password");
9596
await user.click(canvas.getByRole("button", { name: /reset password/i }));
96-
await canvas.findByText(error.response.data.message);
97+
await canvas.findByText(validationDetail);
9798
},
9899
};

0 commit comments

Comments
 (0)