@@ -2428,7 +2428,7 @@ describe("Users", function () {
24282428 it ( "should run the migration and update usernames successfully" , async function ( ) {
24292429 const res = await chai
24302430 . request ( app )
2431- . post ( "/users/migration/update-usernames " )
2431+ . post ( "/users/batch-username-update " )
24322432 . set ( "cookie" , `${ cookieName } =${ superUserAuthToken } ` )
24332433 . send ( ) ;
24342434
@@ -2438,7 +2438,7 @@ describe("Users", function () {
24382438 it ( "should not update usernames for super_user or member" , async function ( ) {
24392439 const res = await chai
24402440 . request ( app )
2441- . post ( "/users/migration/update-usernames " )
2441+ . post ( "/users/batch-username-update " )
24422442 . set ( "cookie" , `${ cookieName } =${ superUserAuthToken } ` )
24432443 . send ( ) ;
24442444
@@ -2450,31 +2450,11 @@ describe("Users", function () {
24502450 it ( "should return 401 for unauthorized user attempting migration" , async function ( ) {
24512451 const res = await chai
24522452 . request ( app )
2453- . post ( "/users/migration/update-usernames " )
2453+ . post ( "/users/batch-username-update " )
24542454 . set ( "cookie" , `${ cookieName } =${ jwt } ` )
24552455 . send ( ) ;
24562456
24572457 expect ( res ) . to . have . status ( 401 ) ;
24582458 } ) ;
2459-
2460- it ( "should update username for users without member and super user true" , async function ( ) {
2461- const userWithoutRoles = userData [ 2 ] ;
2462- const userId = await addUser ( userWithoutRoles ) ;
2463-
2464- const res = await chai
2465- . request ( app )
2466- . post ( "/users/migration/update-usernames" )
2467- . set ( "cookie" , `${ cookieName } =${ superUserAuthToken } ` )
2468- . send ( ) ;
2469-
2470- expect ( res ) . to . have . status ( 200 ) ;
2471- expect ( res . body . totalUpdatedUsernames ) . to . be . greaterThan ( 0 ) ;
2472-
2473- const updatedUser = await firestore . collection ( "users" ) . doc ( userId ) . get ( ) ;
2474-
2475- expect ( updatedUser . data ( ) . username ) . to . include (
2476- `${ userWithoutRoles . first_name . toLowerCase ( ) } -${ userWithoutRoles . last_name . toLowerCase ( ) } -1`
2477- ) ;
2478- } ) ;
24792459 } ) ;
24802460} ) ;
0 commit comments