@@ -68,7 +68,7 @@ describe('Reset Password API Route', () => {
6868
6969 it ( 'should handle missing token' , async ( ) => {
7070 const req = createMockRequest ( 'POST' , {
71- newPassword : 'newSecurePassword123' ,
71+ newPassword : 'newSecurePassword123! ' ,
7272 } )
7373
7474 const response = await POST ( req )
@@ -97,7 +97,7 @@ describe('Reset Password API Route', () => {
9797 it ( 'should handle empty token' , async ( ) => {
9898 const req = createMockRequest ( 'POST' , {
9999 token : '' ,
100- newPassword : 'newSecurePassword123' ,
100+ newPassword : 'newSecurePassword123! ' ,
101101 } )
102102
103103 const response = await POST ( req )
@@ -119,7 +119,11 @@ describe('Reset Password API Route', () => {
119119 const data = await response . json ( )
120120
121121 expect ( response . status ) . toBe ( 400 )
122- expect ( data . message ) . toBe ( 'Password must be at least 8 characters long' )
122+ expect ( data . message ) . toContain ( 'Password must be at least 8 characters long' )
123+ expect ( data . message ) . toContain ( 'Password must contain at least one uppercase letter' )
124+ expect ( data . message ) . toContain ( 'Password must contain at least one lowercase letter' )
125+ expect ( data . message ) . toContain ( 'Password must contain at least one number' )
126+ expect ( data . message ) . toContain ( 'Password must contain at least one special character' )
123127
124128 expect ( mockResetPassword ) . not . toHaveBeenCalled ( )
125129 } )
0 commit comments