@@ -328,6 +328,7 @@ vi.mock("../lib/accounts.js", () => {
328328 incrementAuthFailures ( ) { return 1 ; }
329329 async saveToDisk ( ) { }
330330 markAccountCoolingDown ( ) { }
331+ markAccountsWithRefreshTokenCoolingDown ( ) { return 1 ; }
331332 markRateLimited ( ) { }
332333 markRateLimitedWithReason ( ) { }
333334 consumeToken ( ) { return true ; }
@@ -1348,9 +1349,9 @@ describe("OpenAIOAuthPlugin fetch handler", () => {
13481349 const removeGroupedAccountsSpy = vi
13491350 . spyOn ( AccountManager . prototype , "removeAccountsWithSameRefreshToken" )
13501351 . mockReturnValue ( 0 ) ;
1351- const markAccountCoolingDownSpy = vi . spyOn (
1352+ const markAccountsWithRefreshTokenCoolingDownSpy = vi . spyOn (
13521353 AccountManager . prototype ,
1353- "markAccountCoolingDown " ,
1354+ "markAccountsWithRefreshTokenCoolingDown " ,
13541355 ) ;
13551356
13561357 globalThis . fetch = vi . fn ( ) . mockResolvedValue (
@@ -1367,8 +1368,8 @@ describe("OpenAIOAuthPlugin fetch handler", () => {
13671368 expect ( globalThis . fetch ) . not . toHaveBeenCalled ( ) ;
13681369 expect ( incrementAuthFailuresSpy ) . toHaveBeenCalledTimes ( 1 ) ;
13691370 expect ( removeGroupedAccountsSpy ) . toHaveBeenCalledTimes ( 1 ) ;
1370- expect ( markAccountCoolingDownSpy ) . toHaveBeenCalledWith (
1371- expect . objectContaining ( { index : 0 } ) ,
1371+ expect ( markAccountsWithRefreshTokenCoolingDownSpy ) . toHaveBeenCalledWith (
1372+ "refresh-1" ,
13721373 ACCOUNT_LIMITS . AUTH_FAILURE_COOLDOWN_MS ,
13731374 "auth-failure" ,
13741375 ) ;
0 commit comments