Skip to content

andonary/kata3-password-input-field-validation

Repository files navigation

Kata 3 – Password input field validation

exercise 3 from https://tddmanifesto.com/exercises/

Create a function that can be used as a validator for the password field of a user registration form. The validation function takes a string as an input and returns a validation result. The validation result should contain a boolean indicating if the password is valid or not, and also a field with the possible validation errors.

Requirements

  1. The password must be at least 8 characters long. If it is not met, then the following error message should be returned: “Password must be at least 8 characters”

  2. The password must contain at least 2 numbers. If it is not met, then the following error message should be returned: “The password must contain at least 2 numbers”

  3. The validation function should handle multiple validation errors.

For example, “somepassword” should an error message: “Password must be at least 8 characters\nThe password must contain at least 2 numbers” 4. The password must contain at least one capital letter. If it is not met, then the following error message should be returned: “password must contain at least one capital letter”

  1. The password must contain at least one special character. If it is not met, then the following error message should be returned: “password must contain at least one special character”

Live Coding on YouTube (in french)

Attempt #1 on December the 13th 2021

Part 1 : https://www.youtube.com/watch?v=A99A7ucs1A4

Part 2 : https://www.youtube.com/watch?v=I9KXBqQDQ6A

Conclusion : https://www.youtube.com/watch?v=2MY2_bvllEE

About

exercice from tddmanifesto.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published