@@ -258,7 +258,8 @@ describe("user read tests", function() {
258258 displayName : 'Test 1' ,
259259 authenticationId : new Authentication . Local ( {
260260 _id : mongoose . Types . ObjectId ( ) ,
261- password : 'hide me 1'
261+ password : 'hide me 1' ,
262+ previousPasswords : [ ]
262263 } )
263264 } ) ,
264265 new UserModel ( {
@@ -267,7 +268,8 @@ describe("user read tests", function() {
267268 displayName : 'Test 2' ,
268269 authenticationId : new Authentication . Local ( {
269270 _id : mongoose . Types . ObjectId ( ) ,
270- password : 'hide me 2'
271+ password : 'hide me 2' ,
272+ previousPasswords : [ 'prev 1' , 'prev 2' ]
271273 } )
272274 } )
273275 ] ;
@@ -286,8 +288,10 @@ describe("user read tests", function() {
286288 expect ( Array . isArray ( res . body ) ) . to . be . true ;
287289 expect ( res . body [ 0 ] . authentication . id ) . to . equal ( userDocs [ 0 ] . authenticationId . _id . toHexString ( ) ) ;
288290 expect ( res . body [ 0 ] . authentication ) . to . not . have . property ( 'password' ) ;
291+ expect ( res . body [ 0 ] . authentication ) . to . not . have . property ( 'previousPasswords' ) ;
289292 expect ( res . body [ 1 ] . authentication . id ) . to . equal ( userDocs [ 1 ] . authenticationId . _id . toHexString ( ) ) ;
290293 expect ( res . body [ 1 ] . authentication ) . to . not . have . property ( 'password' ) ;
294+ expect ( res . body [ 1 ] . authentication ) . to . not . have . property ( 'previousPasswords' ) ;
291295 } )
292296
293297 it ( 'redacts local auth password when paging all users' , async function ( ) {
@@ -299,7 +303,8 @@ describe("user read tests", function() {
299303 displayName : 'Test 1' ,
300304 authenticationId : new Authentication . Local ( {
301305 _id : mongoose . Types . ObjectId ( ) ,
302- password : 'hide me 1'
306+ password : 'hide me 1' ,
307+ previousPasswords : [ 'hide this too' ]
303308 } )
304309 } ) ,
305310 new UserModel ( {
@@ -308,7 +313,8 @@ describe("user read tests", function() {
308313 displayName : 'Test 2' ,
309314 authenticationId : new Authentication . Local ( {
310315 _id : mongoose . Types . ObjectId ( ) ,
311- password : 'hide me 2'
316+ password : 'hide me 2' ,
317+ previousPasswords : [ 'hide prev 1' , 'hide prev 2' ]
312318 } )
313319 } )
314320 ] ;
@@ -335,6 +341,7 @@ describe("user read tests", function() {
335341 expect ( Array . isArray ( res . body . items ) ) . to . be . true ;
336342 expect ( res . body . items [ 0 ] . authentication . id ) . to . equal ( userDocs [ 0 ] . authenticationId . _id . toHexString ( ) ) ;
337343 expect ( res . body . items [ 0 ] . authentication ) . to . not . have . property ( 'password' ) ;
344+ expect ( res . body . items [ 0 ] . authentication ) . to . not . have . property ( 'previousPasswords' ) ;
338345 } )
339346
340347
0 commit comments