We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 293125d commit be94818Copy full SHA for be94818
site/src/pages/ResetPasswordPage/ChangePasswordPage.stories.tsx
@@ -51,6 +51,20 @@ export const WrongConfirmationPassword: Story = {
51
},
52
};
53
54
+export const PasswordValidation: Story = {
55
+ play: async ({ canvasElement }) => {
56
+ spyOn(API, "validateUserPassword").mockResolvedValueOnce({
57
+ valid: false,
58
+ details: "Password is too short",
59
+ });
60
+ const canvas = within(canvasElement);
61
+ const user = userEvent.setup();
62
+ const newPasswordInput = await canvas.findByLabelText("Password *");
63
+ await user.type(newPasswordInput, "short");
64
+ await canvas.findByText("Password is too short");
65
+ },
66
+};
67
+
68
export const GeneralServerError: Story = {
69
play: async ({ canvasElement }) => {
70
const serverError =
0 commit comments