-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCAL-245513 : Reset session info cache on init (#147)
- Loading branch information
1 parent
8151bfd
commit dc18c5d
Showing
7 changed files
with
78 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as authToken from '../authToken'; | ||
import { resetAllCachedServices } from './resetServices'; | ||
import * as sessionInfoService from './sessionInfoService'; | ||
|
||
describe('resetAllServices', () => { | ||
it('should reset all services', () => { | ||
const resetCachedAuthTokenSpy = jest.spyOn(authToken, 'resetCachedAuthToken'); | ||
const resetCachedSessionInfoSpy = jest.spyOn(sessionInfoService, 'resetCachedSessionInfo'); | ||
const resetCachedPreauthInfoSpy = jest.spyOn(sessionInfoService, 'resetCachedPreauthInfo'); | ||
resetAllCachedServices(); | ||
expect(resetCachedAuthTokenSpy).toHaveBeenCalled(); | ||
expect(resetCachedSessionInfoSpy).toHaveBeenCalled(); | ||
expect(resetCachedPreauthInfoSpy).toHaveBeenCalled(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { resetCachedAuthToken } from '../authToken'; | ||
import { resetCachedPreauthInfo, resetCachedSessionInfo } from './sessionInfoService'; | ||
|
||
/** | ||
* This function resets all the services that are cached in the SDK. | ||
* This is to be called when the user logs out of the application and also | ||
* when init is called again. | ||
* @version SDK: 1.30.2 | ThoughtSpot: * | ||
*/ | ||
export function resetAllCachedServices(): void { | ||
resetCachedAuthToken(); | ||
resetCachedSessionInfo(); | ||
resetCachedPreauthInfo(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters