@@ -5,7 +5,6 @@ import { generateCurrentTestActivity } from "../../../src/api/controllers/user";
55import * as UserDal from "../../../src/dal/user" ;
66import * as AuthUtils from "../../../src/utils/auth" ;
77import * as BlocklistDal from "../../../src/dal/blocklist" ;
8- import * as ApeKeys from "../../../src/dal/ape-keys" ;
98import * as PresetDal from "../../../src/dal/preset" ;
109import * as ConfigDal from "../../../src/dal/config" ;
1110import * as ResultDal from "../../../src/dal/result" ;
@@ -586,11 +585,11 @@ describe("user controller test", () => {
586585 expect ( testsByDays [ 371 ] ) . toEqual ( 2024094 ) ; //2024-01
587586 } ) ;
588587 } ) ;
589- describe ( "delete user" , ( ) => {
588+ describe ( "delete user " , ( ) => {
590589 const getUserMock = vi . spyOn ( UserDal , "getPartialUser" ) ;
591590 const deleteUserMock = vi . spyOn ( UserDal , "deleteUser" ) ;
592591 const firebaseDeleteUserMock = vi . spyOn ( AuthUtils , "deleteUser" ) ;
593- const deleteAllApeKeysMock = vi . spyOn ( ApeKeys , "deleteAllApeKeys" ) ;
592+ const deleteAllApeKeysMock = vi . spyOn ( ApeKeysDal , "deleteAllApeKeys" ) ;
594593 const deleteAllPresetsMock = vi . spyOn ( PresetDal , "deleteAllPresets" ) ;
595594 const deleteConfigMock = vi . spyOn ( ConfigDal , "deleteConfig" ) ;
596595 const deleteAllResultMock = vi . spyOn ( ResultDal , "deleteAll" ) ;
@@ -894,13 +893,15 @@ describe("user controller test", () => {
894893 data : null ,
895894 } ) ;
896895
897- [
896+ for ( const it of [
898897 resetUserMock ,
899898 deleteAllApeKeysMock ,
900899 deleteAllPresetsMock ,
901900 deleteAllResultsMock ,
902901 deleteConfigMock ,
903- ] . forEach ( ( it ) => expect ( it ) . toHaveBeenCalledWith ( uid ) ) ;
902+ ] ) {
903+ expect ( it ) . toHaveBeenCalledWith ( uid ) ;
904+ }
904905 expect ( purgeUserFromDailyLeaderboardsMock ) . toHaveBeenCalledWith (
905906 uid ,
906907 ( await Configuration . getLiveConfiguration ( ) ) . dailyLeaderboards
@@ -1178,19 +1179,18 @@ describe("user controller test", () => {
11781179 uid
11791180 ) ;
11801181 } ) ;
1181- it ( "should fail with unknown properties" , async ( ) => {
1182- //WHEN
1183- const { body } = await mockApp
1184- . post ( "/users/optOutOfLeaderboards" )
1185- . set ( "Authorization" , `Bearer ${ uid } ` )
1186- . send ( { extra : "value" } ) ;
1187- //TODO.expect(422);
1188-
1189- //THEN
1190- /* TODO:
1182+ // it("should fail with unknown properties", async () => {
1183+ //WHEN
1184+ // const { body } = await mockApp
1185+ // .post("/users/optOutOfLeaderboards")
1186+ // .set("Authorization", `Bearer ${uid}`)
1187+ // .send({ extra: "value" });
1188+ //TODO.expect(422);
1189+ //THEN
1190+ /* TODO:
11911191 expect(body).toEqual({});
11921192 */
1193- } ) ;
1193+ // });
11941194 } ) ;
11951195 describe ( "update email" , ( ) => {
11961196 const authUpdateEmailMock = vi . spyOn ( AuthUtils , "updateUserEmail" ) ;
@@ -2280,7 +2280,7 @@ describe("user controller test", () => {
22802280 updateLbMemoryMock . mockReset ( ) ;
22812281 } ) ;
22822282
2283- it ( "should update lb " , async ( ) => {
2283+ it ( "should update lb" , async ( ) => {
22842284 //WHEN
22852285 const { body } = await mockApp
22862286 . patch ( "/users/leaderboardMemory" )
@@ -2388,7 +2388,7 @@ describe("user controller test", () => {
23882388 addThemeMock . mockReset ( ) ;
23892389 } ) ;
23902390
2391- it ( "should add " , async ( ) => {
2391+ it ( "should add" , async ( ) => {
23922392 //GIVEN
23932393 const addedTheme : UserDal . DBCustomTheme = {
23942394 _id : new ObjectId ( ) ,
@@ -3812,6 +3812,7 @@ async function enablePremiumFeatures(premium: boolean): Promise<void> {
38123812 ) ;
38133813}
38143814
3815+ // eslint-disable-next-line no-unused-vars
38153816async function enableAdminFeatures ( enabled : boolean ) : Promise < void > {
38163817 const mockConfig = _ . merge ( await configuration , {
38173818 admin : { endpointsEnabled : enabled } ,
0 commit comments