@@ -33,15 +33,6 @@ test("password with less than 5 characters is invalid", () => {
3333 expect ( result ) . toEqual ( false ) ;
3434} ) ;
3535
36- test ( "password has at least one English uppercase letter (A-Z)" , ( ) => {
37- // Arrange
38- const password = "1234bA$" ;
39- // Act
40- const result = isValidPassword ( password ) ;
41- // Assert
42- expect ( result ) . toEqual ( true ) ;
43- } ) ;
44-
4536test ( "password with no uppercase letters is invalid" , ( ) => {
4637 // Arrange
4738 const password = "1234ab$" ;
@@ -51,15 +42,6 @@ test("password with no uppercase letters is invalid", () => {
5142 expect ( result ) . toEqual ( false ) ;
5243} ) ;
5344
54- test ( "password has at least one English lowercase letter (a-z)" , ( ) => {
55- // Arrange
56- const password = "1234Aa%" ;
57- // Act
58- const result = isValidPassword ( password ) ;
59- // Assert
60- expect ( result ) . toEqual ( true ) ;
61- } ) ;
62-
6345test ( "password with no lowercase letters is invalid" , ( ) => {
6446 // Arrange
6547 const password = "1234AB$" ;
@@ -69,15 +51,6 @@ test("password with no lowercase letters is invalid", () => {
6951 expect ( result ) . toEqual ( false ) ;
7052} ) ;
7153
72- test ( "password has at least one number (0-9)" , ( ) => {
73- // Arrange
74- const password = "1234Aa&" ;
75- // Act
76- const result = isValidPassword ( password ) ;
77- // Assert
78- expect ( result ) . toEqual ( true ) ;
79- } ) ;
80-
8154test ( "password with no numbers is invalid" , ( ) => {
8255 // Arrange
8356 const password = "passWord!" ;
@@ -87,22 +60,13 @@ test("password with no numbers is invalid", () => {
8760 expect ( result ) . toEqual ( false ) ;
8861} ) ;
8962
90- test ( "password has at least one non-alphanumeric symbol: (!, #, $, %, ., *, &) " , ( ) => {
63+ test ( "password with non-alphanumeric symbols is invalid " , ( ) => {
9164 // Arrange
92- const password = "1234aA# " ;
65+ const password = "1234aAv " ;
9366 // Act
9467 const result = isValidPassword ( password ) ;
9568 // Assert
96- expect ( result ) . toEqual ( true ) ;
97- } ) ;
98-
99- test ( "must not be any previous password in the passwords array." , ( ) => {
100- // Arrange
101- const password = "pas$W0rd" ;
102- // Act
103- const result = isValidPassword ( password ) ;
104- // Assert
105- expect ( result ) . toEqual ( true ) ;
69+ expect ( result ) . toEqual ( false ) ;
10670} ) ;
10771
10872test ( "previous passwords in the passwords array are invalid" , ( ) => {
0 commit comments