@@ -29,51 +29,51 @@ test("should reject password with less than 5 characters", () => {
2929 expect ( result ) . toEqual ( false ) ;
3030} ) ;
3131
32- test ( "should require at least one uppercase letter" , ( ) => {
32+ test ( "should return true if the password has at least one uppercase english letter " , ( ) => {
3333 const password = "12345Aaoe$" ;
3434 const result = isValidPassword ( password ) ;
3535 expect ( result ) . toEqual ( true ) ;
3636} ) ;
37- test ( "should reject password without uppercase letter" , ( ) => {
37+ test ( "should reject password without an english uppercase letter" , ( ) => {
3838 const password = "12345" ;
3939 const result = isValidPassword ( password ) ;
4040 expect ( result ) . toEqual ( false ) ;
4141} ) ;
4242
43- test ( "should require at least one lowercase letter" , ( ) => {
43+ test ( "should return true if the password has at least one english lowercase letter" , ( ) => {
4444 const password = "S12345h#" ;
4545 const result = isValidPassword ( password ) ;
4646 expect ( result ) . toEqual ( true ) ;
4747} ) ;
48- test ( "should reject password without lowercase letter" , ( ) => {
49- const password = "S12345P" ;
48+ test ( "should return false if the password doesn't have at least one english lowercase letter" , ( ) => {
49+ const password = "S12345P! " ;
5050 const result = isValidPassword ( password ) ;
5151 expect ( result ) . toEqual ( false ) ;
5252} ) ;
5353
54- test ( "should require at least one number" , ( ) => {
54+ test ( "should return true if the password hasn't got at least one number " , ( ) => {
5555 const password = "123456Aa%" ;
5656 const result = isValidPassword ( password ) ;
5757 expect ( result ) . toEqual ( true ) ;
5858} ) ;
59- test ( "should reject password without number" , ( ) => {
60- const password = "sgjjkdAa" ;
59+ test ( "should return false if the password doesn't have at least one number" , ( ) => {
60+ const password = "sgjjkdAa% " ;
6161 const result = isValidPassword ( password ) ;
6262 expect ( result ) . toEqual ( false ) ;
6363} ) ;
6464
65- test ( "should require at least one special symbol" , ( ) => {
65+ test ( "should return true if the password has at least one special symbol(!, #, $, %, ., *, &) " , ( ) => {
6666 const password = "123Spdfe!" ;
6767 const result = isValidPassword ( password ) ;
6868 expect ( result ) . toEqual ( true ) ;
6969} ) ;
70- test ( "should reject password without special symbol" , ( ) => {
70+ test ( "should return false if the password doesn't include a special symbol(!, #, $, %, ., *, &) " , ( ) => {
7171 const password = "123Spdfe" ;
7272 const result = isValidPassword ( password ) ;
7373 expect ( result ) . toEqual ( false ) ;
7474} ) ;
7575
76- test ( "should reject passwords which have been used before" , ( ) => {
76+ test ( "should return false if the password has been used before" , ( ) => {
7777 const password = "123Spdfe!" ;
7878 const oldPasswords = [ "hsqsgf" , "123Spdfe!" ] ;
7979 const result = isValidPassword ( password , oldPasswords )
0 commit comments