File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,26 @@ describe("[POST] /api/auth/register", () => {
9797 expect ( res . body . id ) . toBeTruthy ( ) ;
9898 } )
9999
100+ test ( '[5] response password does not equal password send (response password is encrypted)' , async ( ) => {
101+ let res = await request ( server )
102+ . post ( "/api/auth/register" )
103+ . send ( { username : "george" , password : "pass" } ) ;
104+
105+ expect ( res . body . password ) . not . toBe ( "pass" ) ;
106+
107+ res = await request ( server )
108+ . post ( "/api/auth/register" )
109+ . send ( { username : "juan" , password : "1234" } ) ;
110+
111+ expect ( res . body . password ) . not . toBe ( "1234" ) ;
112+
113+ res = await request ( server )
114+ . post ( "/api/auth/register" )
115+ . send ( { username : "matthew" , password : "matthew" } ) ;
116+
117+ expect ( res . body . password ) . not . toBe ( "matthew" ) ;
118+ } )
119+
100120 test ( '[5] responds with newly created user' , async ( ) => {
101121 let res = await request ( server ) . post ( "/api/auth/register" ) . send ( { username : "george" , password : "pass" } ) ;
102122 expect ( res . body ) . toMatchObject ( { username : "george" } ) ;
You can’t perform that action at this time.
0 commit comments