Skip to content

Commit be94818

Browse files
committed
test(notifiations): working on storybook
1 parent 293125d commit be94818

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

+14
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ export const WrongConfirmationPassword: Story = {
5151
},
5252
};
5353

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+
5468
export const GeneralServerError: Story = {
5569
play: async ({ canvasElement }) => {
5670
const serverError =

0 commit comments

Comments
 (0)