mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
PM-5501 - VaultTimeoutSettingsSvc State Provider Migration - Small bugfixes (#9164)
* PM-5501 - VaultTimeoutSettingsSvc - fix setVaultTimeoutOptions condition which needed to use never instead of null. * PM-5501 - Fix browser and desktop not showing the never lock warning * PM-5501 - Use true equality.
This commit is contained in:
@@ -313,7 +313,7 @@ describe("VaultTimeoutSettingsService", () => {
|
||||
expect(cryptoService.refreshAdditionalKeys).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should clear the tokens when the timeout is non-null and the action is log out", async () => {
|
||||
it("should clear the tokens when the timeout is not never and the action is log out", async () => {
|
||||
// Arrange
|
||||
const action = VaultTimeoutAction.LogOut;
|
||||
const timeout = 30;
|
||||
@@ -324,6 +324,18 @@ describe("VaultTimeoutSettingsService", () => {
|
||||
// Assert
|
||||
expect(tokenService.clearTokens).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should not clear the tokens when the timeout is never and the action is log out", async () => {
|
||||
// Arrange
|
||||
const action = VaultTimeoutAction.LogOut;
|
||||
const timeout = VaultTimeoutStringType.Never;
|
||||
|
||||
// Act
|
||||
await vaultTimeoutSettingsService.setVaultTimeoutOptions(mockUserId, timeout, action);
|
||||
|
||||
// Assert
|
||||
expect(tokenService.clearTokens).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
function createVaultTimeoutSettingsService(
|
||||
|
||||
Reference in New Issue
Block a user