fix: fix all biome

This commit is contained in:
2025-01-31 05:57:51 +08:00
parent 316361bd3c
commit c9d0066d64
114 changed files with 2255 additions and 2068 deletions

View File

@@ -1,5 +1,5 @@
import { TestBed, spyOnProperty } from '@/testing';
import { lastValueFrom, of, throwError } from 'rxjs';
import { EmptyError, lastValueFrom, of, throwError } from 'rxjs';
import { delay } from 'rxjs/operators';
import { vi } from 'vitest';
import { AuthStateService } from '../auth-state/auth-state.service';
@@ -216,18 +216,22 @@ describe('RefreshSessionService ', () => {
},
];
refreshSessionService
.userForceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe({
error: () => {
expect.fail('It should not return any error.');
},
complete: () => {
expect(
flowsDataService.resetSilentRenewRunning
).toHaveBeenCalledExactlyOnceWith(allConfigs[0]);
},
});
try {
await lastValueFrom(
refreshSessionService.userForceRefreshSession(
allConfigs[0]!,
allConfigs
)
);
} catch (err: any) {
if (err instanceof EmptyError) {
expect(
flowsDataService.resetSilentRenewRunning
).toHaveBeenCalledExactlyOnceWith(allConfigs[0]);
} else {
expect.fail('It should not return any error.');
}
}
});
});
@@ -448,18 +452,16 @@ describe('RefreshSessionService ', () => {
'resetSilentRenewRunning'
);
refreshSessionService
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe({
next: () => {
expect.fail('It should not return any result.');
},
error: (error) => {
expect(error).toBeInstanceOf(Error);
expect(error.message).toEqual(`Error: ${expectedErrorMessage}`);
expect(resetSilentRenewRunningSpy).not.toHaveBeenCalled();
},
});
try {
await lastValueFrom(
refreshSessionService.forceRefreshSession(allConfigs[0]!, allConfigs)
);
expect.fail('It should not return any result.');
} catch (error: any) {
expect(error).toBeInstanceOf(Error);
expect(error.message).toEqual(`Error: ${expectedErrorMessage}`);
expect(resetSilentRenewRunningSpy).not.toHaveBeenCalled();
}
});
describe('NOT isCurrentFlowCodeFlowWithRefreshTokens', () => {