feat: init

This commit is contained in:
2025-01-30 20:02:28 +08:00
parent da0d9855da
commit 1785df25e2
125 changed files with 8601 additions and 4725 deletions

View File

@@ -1,17 +1,18 @@
import { fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
import { TestBed, fakeAsync, tick } from '@/testing';
import { of, throwError } from 'rxjs';
import { delay } from 'rxjs/operators';
import { mockProvider } from '../../test/auto-mock';
import { vi } from 'vitest';
import { AuthStateService } from '../auth-state/auth-state.service';
import { AuthWellKnownService } from '../config/auth-well-known/auth-well-known.service';
import { CallbackContext } from '../flows/callback-context';
import type { CallbackContext } from '../flows/callback-context';
import { FlowsDataService } from '../flows/flows-data.service';
import { RefreshSessionIframeService } from '../iframe/refresh-session-iframe.service';
import { SilentRenewService } from '../iframe/silent-renew.service';
import { LoggerService } from '../logging/logger.service';
import { LoginResponse } from '../login/login-response';
import type { LoginResponse } from '../login/login-response';
import { PublicEventsService } from '../public-events/public-events.service';
import { StoragePersistenceService } from '../storage/storage-persistence.service';
import { mockProvider } from '../testing/mock';
import { UserService } from '../user-data/user.service';
import { FlowHelper } from '../utils/flowHelper/flow-helper.service';
import { RefreshSessionRefreshTokenService } from './refresh-session-refresh-token.service';
@@ -70,19 +71,19 @@ describe('RefreshSessionService ', () => {
});
describe('userForceRefreshSession', () => {
it('should persist params refresh when extra custom params given and useRefreshToken is true', waitForAsync(() => {
spyOn(
it('should persist params refresh when extra custom params given and useRefreshToken is true', async () => {
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(true);
spyOn(
).mockReturnValue(true);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(of(null));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
true
);
const writeSpy = spyOn(storagePersistenceService, 'write');
const writeSpy = vi.spyOn(storagePersistenceService, 'write');
const allConfigs = [
{
configId: 'configId1',
@@ -94,26 +95,26 @@ describe('RefreshSessionService ', () => {
const extraCustomParams = { extra: 'custom' };
refreshSessionService
.userForceRefreshSession(allConfigs[0], allConfigs, extraCustomParams)
.userForceRefreshSession(allConfigs[0]!, allConfigs, extraCustomParams)
.subscribe(() => {
expect(writeSpy).toHaveBeenCalledOnceWith(
expect(writeSpy).toHaveBeenCalledExactlyOnceWith(
'storageCustomParamsRefresh',
extraCustomParams,
allConfigs[0]
);
});
}));
});
it('should persist storageCustomParamsAuthRequest when extra custom params given and useRefreshToken is false', waitForAsync(() => {
spyOn(
it('should persist storageCustomParamsAuthRequest when extra custom params given and useRefreshToken is false', async () => {
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(true);
spyOn(
).mockReturnValue(true);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(of(null));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
true
);
const allConfigs = [
@@ -123,31 +124,31 @@ describe('RefreshSessionService ', () => {
silentRenewTimeoutInSeconds: 10,
},
];
const writeSpy = spyOn(storagePersistenceService, 'write');
const writeSpy = vi.spyOn(storagePersistenceService, 'write');
const extraCustomParams = { extra: 'custom' };
refreshSessionService
.userForceRefreshSession(allConfigs[0], allConfigs, extraCustomParams)
.userForceRefreshSession(allConfigs[0]!, allConfigs, extraCustomParams)
.subscribe(() => {
expect(writeSpy).toHaveBeenCalledOnceWith(
expect(writeSpy).toHaveBeenCalledExactlyOnceWith(
'storageCustomParamsAuthRequest',
extraCustomParams,
allConfigs[0]
);
});
}));
});
it('should NOT persist customparams if no customparams are given', waitForAsync(() => {
spyOn(
it('should NOT persist customparams if no customparams are given', async () => {
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(true);
spyOn(
).mockReturnValue(true);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(of(null));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
true
);
const allConfigs = [
@@ -157,20 +158,20 @@ describe('RefreshSessionService ', () => {
silentRenewTimeoutInSeconds: 10,
},
];
const writeSpy = spyOn(storagePersistenceService, 'write');
const writeSpy = vi.spyOn(storagePersistenceService, 'write');
refreshSessionService
.userForceRefreshSession(allConfigs[0], allConfigs)
.userForceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe(() => {
expect(writeSpy).not.toHaveBeenCalled();
});
}));
});
it('should call resetSilentRenewRunning in case of an error', waitForAsync(() => {
spyOn(refreshSessionService, 'forceRefreshSession').and.returnValue(
it('should call resetSilentRenewRunning in case of an error', async () => {
vi.spyOn(refreshSessionService, 'forceRefreshSession').mockReturnValue(
throwError(() => new Error('error'))
);
spyOn(flowsDataService, 'resetSilentRenewRunning');
vi.spyOn(flowsDataService, 'resetSilentRenewRunning');
const allConfigs = [
{
configId: 'configId1',
@@ -180,7 +181,7 @@ describe('RefreshSessionService ', () => {
];
refreshSessionService
.userForceRefreshSession(allConfigs[0], allConfigs)
.userForceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe({
next: () => {
fail('It should not return any result.');
@@ -191,16 +192,16 @@ describe('RefreshSessionService ', () => {
complete: () => {
expect(
flowsDataService.resetSilentRenewRunning
).toHaveBeenCalledOnceWith(allConfigs[0]);
).toHaveBeenCalledExactlyOnceWith(allConfigs[0]);
},
});
}));
});
it('should call resetSilentRenewRunning in case of no error', waitForAsync(() => {
spyOn(refreshSessionService, 'forceRefreshSession').and.returnValue(
it('should call resetSilentRenewRunning in case of no error', async () => {
vi.spyOn(refreshSessionService, 'forceRefreshSession').mockReturnValue(
of({} as LoginResponse)
);
spyOn(flowsDataService, 'resetSilentRenewRunning');
vi.spyOn(flowsDataService, 'resetSilentRenewRunning');
const allConfigs = [
{
configId: 'configId1',
@@ -210,7 +211,7 @@ describe('RefreshSessionService ', () => {
];
refreshSessionService
.userForceRefreshSession(allConfigs[0], allConfigs)
.userForceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe({
error: () => {
fail('It should not return any error.');
@@ -218,27 +219,29 @@ describe('RefreshSessionService ', () => {
complete: () => {
expect(
flowsDataService.resetSilentRenewRunning
).toHaveBeenCalledOnceWith(allConfigs[0]);
).toHaveBeenCalledExactlyOnceWith(allConfigs[0]);
},
});
}));
});
});
describe('forceRefreshSession', () => {
it('only calls start refresh session and returns idToken and accessToken if auth is true', waitForAsync(() => {
spyOn(
it('only calls start refresh session and returns idToken and accessToken if auth is true', async () => {
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(true);
spyOn(
).mockReturnValue(true);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(of(null));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
true
);
spyOn(authStateService, 'getIdToken').and.returnValue('id-token');
spyOn(authStateService, 'getAccessToken').and.returnValue('access-token');
vi.spyOn(authStateService, 'getIdToken').mockReturnValue('id-token');
vi.spyOn(authStateService, 'getAccessToken').mockReturnValue(
'access-token'
);
const allConfigs = [
{
configId: 'configId1',
@@ -247,23 +250,23 @@ describe('RefreshSessionService ', () => {
];
refreshSessionService
.forceRefreshSession(allConfigs[0], allConfigs)
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe((result) => {
expect(result.idToken).toEqual('id-token');
expect(result.accessToken).toEqual('access-token');
});
}));
});
it('only calls start refresh session and returns null if auth is false', waitForAsync(() => {
spyOn(
it('only calls start refresh session and returns null if auth is false', async () => {
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(true);
spyOn(
).mockReturnValue(true);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(of(null));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
false
);
const allConfigs = [
@@ -274,7 +277,7 @@ describe('RefreshSessionService ', () => {
];
refreshSessionService
.forceRefreshSession(allConfigs[0], allConfigs)
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe((result) => {
expect(result).toEqual({
isAuthenticated: false,
@@ -285,24 +288,24 @@ describe('RefreshSessionService ', () => {
configId: 'configId1',
});
});
}));
});
it('calls start refresh session and waits for completed, returns idtoken and accesstoken if auth is true', waitForAsync(() => {
spyOn(
it('calls start refresh session and waits for completed, returns idtoken and accesstoken if auth is true', async () => {
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(false);
spyOn(
).mockReturnValue(false);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(of(null));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
true
);
spyOnProperty(
vi.spyOnProperty(
silentRenewService,
'refreshSessionWithIFrameCompleted$'
).and.returnValue(
).mockReturnValue(
of({
authResult: {
id_token: 'some-id_token',
@@ -318,29 +321,29 @@ describe('RefreshSessionService ', () => {
];
refreshSessionService
.forceRefreshSession(allConfigs[0], allConfigs)
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe((result) => {
expect(result.idToken).toBeDefined();
expect(result.accessToken).toBeDefined();
});
}));
});
it('calls start refresh session and waits for completed, returns LoginResponse if auth is false', waitForAsync(() => {
spyOn(
it('calls start refresh session and waits for completed, returns LoginResponse if auth is false', async () => {
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(false);
spyOn(
).mockReturnValue(false);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(of(null));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
false
);
spyOnProperty(
vi.spyOnProperty(
silentRenewService,
'refreshSessionWithIFrameCompleted$'
).and.returnValue(of(null));
).mockReturnValue(of(null));
const allConfigs = [
{
configId: 'configId1',
@@ -349,7 +352,7 @@ describe('RefreshSessionService ', () => {
];
refreshSessionService
.forceRefreshSession(allConfigs[0], allConfigs)
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe((result) => {
expect(result).toEqual({
isAuthenticated: false,
@@ -360,23 +363,23 @@ describe('RefreshSessionService ', () => {
configId: 'configId1',
});
});
}));
});
it('occurs timeout error and retry mechanism exhausted max retry count throws error', fakeAsync(() => {
spyOn(
it('occurs timeout error and retry mechanism exhausted max retry count throws error', async () => {
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(false);
spyOn(
).mockReturnValue(false);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOnProperty(
).mockReturnValue(of(null));
vi.spyOnProperty(
silentRenewService,
'refreshSessionWithIFrameCompleted$'
).and.returnValue(of(null).pipe(delay(11000)));
).mockReturnValue(of(null).pipe(delay(11000)));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
false
);
const allConfigs = [
@@ -386,14 +389,14 @@ describe('RefreshSessionService ', () => {
},
];
const resetSilentRenewRunningSpy = spyOn(
const resetSilentRenewRunningSpy = vi.spyOn(
flowsDataService,
'resetSilentRenewRunning'
);
const expectedInvokeCount = MAX_RETRY_ATTEMPTS;
refreshSessionService
.forceRefreshSession(allConfigs[0], allConfigs)
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe({
next: () => {
fail('It should not return any result.');
@@ -407,9 +410,9 @@ describe('RefreshSessionService ', () => {
});
tick(allConfigs[0].silentRenewTimeoutInSeconds * 10000);
}));
});
it('occurs unknown error throws it to subscriber', fakeAsync(() => {
it('occurs unknown error throws it to subscriber', async () => {
const allConfigs = [
{
configId: 'configId1',
@@ -419,29 +422,29 @@ describe('RefreshSessionService ', () => {
const expectedErrorMessage = 'Test error message';
spyOn(
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(false);
spyOnProperty(
).mockReturnValue(false);
vi.spyOnProperty(
silentRenewService,
'refreshSessionWithIFrameCompleted$'
).and.returnValue(of(null));
spyOn(
).mockReturnValue(of(null));
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(throwError(() => new Error(expectedErrorMessage)));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(throwError(() => new Error(expectedErrorMessage)));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
false
);
const resetSilentRenewRunningSpy = spyOn(
const resetSilentRenewRunningSpy = vi.spyOn(
flowsDataService,
'resetSilentRenewRunning'
);
refreshSessionService
.forceRefreshSession(allConfigs[0], allConfigs)
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe({
next: () => {
fail('It should not return any result.');
@@ -452,10 +455,10 @@ describe('RefreshSessionService ', () => {
expect(resetSilentRenewRunningSpy).not.toHaveBeenCalled();
},
});
}));
});
describe('NOT isCurrentFlowCodeFlowWithRefreshTokens', () => {
it('does return null when not authenticated', waitForAsync(() => {
it('does return null when not authenticated', async () => {
const allConfigs = [
{
configId: 'configId1',
@@ -463,24 +466,24 @@ describe('RefreshSessionService ', () => {
},
];
spyOn(
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(false);
spyOn(
).mockReturnValue(false);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOn(authStateService, 'areAuthStorageTokensValid').and.returnValue(
).mockReturnValue(of(null));
vi.spyOn(authStateService, 'areAuthStorageTokensValid').mockReturnValue(
false
);
spyOnProperty(
vi.spyOnProperty(
silentRenewService,
'refreshSessionWithIFrameCompleted$'
).and.returnValue(of(null));
).mockReturnValue(of(null));
refreshSessionService
.forceRefreshSession(allConfigs[0], allConfigs)
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe((result) => {
expect(result).toEqual({
isAuthenticated: false,
@@ -491,9 +494,9 @@ describe('RefreshSessionService ', () => {
configId: 'configId1',
});
});
}));
});
it('return value only returns once', waitForAsync(() => {
it('return value only returns once', async () => {
const allConfigs = [
{
configId: 'configId1',
@@ -501,18 +504,18 @@ describe('RefreshSessionService ', () => {
},
];
spyOn(
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(false);
spyOn(
).mockReturnValue(false);
vi.spyOn(
refreshSessionService as any,
'startRefreshSession'
).and.returnValue(of(null));
spyOnProperty(
).mockReturnValue(of(null));
vi.spyOnProperty(
silentRenewService,
'refreshSessionWithIFrameCompleted$'
).and.returnValue(
).mockReturnValue(
of({
authResult: {
id_token: 'some-id_token',
@@ -520,13 +523,12 @@ describe('RefreshSessionService ', () => {
},
} as CallbackContext)
);
const spyInsideMap = spyOn(
authStateService,
'areAuthStorageTokensValid'
).and.returnValue(true);
const spyInsideMap = vi
.spyOn(authStateService, 'areAuthStorageTokensValid')
.mockReturnValue(true);
refreshSessionService
.forceRefreshSession(allConfigs[0], allConfigs)
.forceRefreshSession(allConfigs[0]!, allConfigs)
.subscribe((result) => {
expect(result).toEqual({
idToken: 'some-id_token',
@@ -537,33 +539,33 @@ describe('RefreshSessionService ', () => {
});
expect(spyInsideMap).toHaveBeenCalledTimes(1);
});
}));
});
});
});
describe('startRefreshSession', () => {
it('returns null if no auth well known endpoint defined', waitForAsync(() => {
spyOn(flowsDataService, 'isSilentRenewRunning').and.returnValue(true);
it('returns null if no auth well known endpoint defined', async () => {
vi.spyOn(flowsDataService, 'isSilentRenewRunning').mockReturnValue(true);
(refreshSessionService as any)
.startRefreshSession()
.subscribe((result: any) => {
expect(result).toBe(null);
});
}));
});
it('returns null if silent renew Is running', waitForAsync(() => {
spyOn(flowsDataService, 'isSilentRenewRunning').and.returnValue(true);
it('returns null if silent renew Is running', async () => {
vi.spyOn(flowsDataService, 'isSilentRenewRunning').mockReturnValue(true);
(refreshSessionService as any)
.startRefreshSession()
.subscribe((result: any) => {
expect(result).toBe(null);
});
}));
});
it('calls `setSilentRenewRunning` when should be executed', waitForAsync(() => {
const setSilentRenewRunningSpy = spyOn(
it('calls `setSilentRenewRunning` when should be executed', async () => {
const setSilentRenewRunningSpy = vi.spyOn(
flowsDataService,
'setSilentRenewRunning'
);
@@ -574,30 +576,30 @@ describe('RefreshSessionService ', () => {
},
];
spyOn(flowsDataService, 'isSilentRenewRunning').and.returnValue(false);
spyOn(
vi.spyOn(flowsDataService, 'isSilentRenewRunning').mockReturnValue(false);
vi.spyOn(
authWellKnownService,
'queryAndStoreAuthWellKnownEndPoints'
).and.returnValue(of({}));
).mockReturnValue(of({}));
spyOn(
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(true);
spyOn(
).mockReturnValue(true);
vi.spyOn(
refreshSessionRefreshTokenService,
'refreshSessionWithRefreshTokens'
).and.returnValue(of({} as CallbackContext));
).mockReturnValue(of({} as CallbackContext));
(refreshSessionService as any)
.startRefreshSession(allConfigs[0], allConfigs)
.startRefreshSession(allConfigs[0]!, allConfigs)
.subscribe(() => {
expect(setSilentRenewRunningSpy).toHaveBeenCalled();
});
}));
});
it('calls refreshSessionWithRefreshTokens when current flow is codeflow with refresh tokens', waitForAsync(() => {
spyOn(flowsDataService, 'setSilentRenewRunning');
it('calls refreshSessionWithRefreshTokens when current flow is codeflow with refresh tokens', async () => {
vi.spyOn(flowsDataService, 'setSilentRenewRunning');
const allConfigs = [
{
configId: 'configId1',
@@ -605,30 +607,32 @@ describe('RefreshSessionService ', () => {
},
];
spyOn(flowsDataService, 'isSilentRenewRunning').and.returnValue(false);
spyOn(
vi.spyOn(flowsDataService, 'isSilentRenewRunning').mockReturnValue(false);
vi.spyOn(
authWellKnownService,
'queryAndStoreAuthWellKnownEndPoints'
).and.returnValue(of({}));
).mockReturnValue(of({}));
spyOn(
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(true);
const refreshSessionWithRefreshTokensSpy = spyOn(
refreshSessionRefreshTokenService,
'refreshSessionWithRefreshTokens'
).and.returnValue(of({} as CallbackContext));
).mockReturnValue(true);
const refreshSessionWithRefreshTokensSpy = vi
.spyOn(
refreshSessionRefreshTokenService,
'refreshSessionWithRefreshTokens'
)
.mockReturnValue(of({} as CallbackContext));
(refreshSessionService as any)
.startRefreshSession(allConfigs[0], allConfigs)
.startRefreshSession(allConfigs[0]!, allConfigs)
.subscribe(() => {
expect(refreshSessionWithRefreshTokensSpy).toHaveBeenCalled();
});
}));
});
it('calls refreshSessionWithIframe when current flow is NOT codeflow with refresh tokens', waitForAsync(() => {
spyOn(flowsDataService, 'setSilentRenewRunning');
it('calls refreshSessionWithIframe when current flow is NOT codeflow with refresh tokens', async () => {
vi.spyOn(flowsDataService, 'setSilentRenewRunning');
const allConfigs = [
{
configId: 'configId1',
@@ -636,32 +640,33 @@ describe('RefreshSessionService ', () => {
},
];
spyOn(flowsDataService, 'isSilentRenewRunning').and.returnValue(false);
spyOn(
vi.spyOn(flowsDataService, 'isSilentRenewRunning').mockReturnValue(false);
vi.spyOn(
authWellKnownService,
'queryAndStoreAuthWellKnownEndPoints'
).and.returnValue(of({}));
).mockReturnValue(of({}));
spyOn(
vi.spyOn(
flowHelper,
'isCurrentFlowCodeFlowWithRefreshTokens'
).and.returnValue(false);
const refreshSessionWithRefreshTokensSpy = spyOn(
refreshSessionRefreshTokenService,
'refreshSessionWithRefreshTokens'
).and.returnValue(of({} as CallbackContext));
).mockReturnValue(false);
const refreshSessionWithRefreshTokensSpy = vi
.spyOn(
refreshSessionRefreshTokenService,
'refreshSessionWithRefreshTokens'
)
.mockReturnValue(of({} as CallbackContext));
const refreshSessionWithIframeSpy = spyOn(
refreshSessionIframeService,
'refreshSessionWithIframe'
).and.returnValue(of(false));
const refreshSessionWithIframeSpy = vi
.spyOn(refreshSessionIframeService, 'refreshSessionWithIframe')
.mockReturnValue(of(false));
(refreshSessionService as any)
.startRefreshSession(allConfigs[0], allConfigs)
.startRefreshSession(allConfigs[0]!, allConfigs)
.subscribe(() => {
expect(refreshSessionWithRefreshTokensSpy).not.toHaveBeenCalled();
expect(refreshSessionWithIframeSpy).toHaveBeenCalled();
});
}));
});
});
});