mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
[deps] Autofill: Update prettier to v3 (#7014)
* [deps] Autofill: Update prettier to v3 * prettier formatting updates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
@@ -31,7 +31,7 @@ describe("VaultTimeoutSettingsService", () => {
|
||||
tokenService,
|
||||
policyService,
|
||||
stateService,
|
||||
userVerificationService
|
||||
userVerificationService,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -100,14 +100,14 @@ describe("VaultTimeoutSettingsService", () => {
|
||||
userVerificationService.hasMasterPassword.mockResolvedValue(true);
|
||||
policyService.policyAppliesToUser.mockResolvedValue(policy === null ? false : true);
|
||||
policyService.getAll.mockResolvedValue(
|
||||
policy === null ? [] : ([{ data: { action: policy } }] as unknown as Policy[])
|
||||
policy === null ? [] : ([{ data: { action: policy } }] as unknown as Policy[]),
|
||||
);
|
||||
stateService.getVaultTimeoutAction.mockResolvedValue(userPreference);
|
||||
|
||||
const result = await firstValueFrom(service.vaultTimeoutAction$());
|
||||
|
||||
expect(result).toBe(expected);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -128,14 +128,14 @@ describe("VaultTimeoutSettingsService", () => {
|
||||
userVerificationService.hasMasterPassword.mockResolvedValue(false);
|
||||
policyService.policyAppliesToUser.mockResolvedValue(policy === null ? false : true);
|
||||
policyService.getAll.mockResolvedValue(
|
||||
policy === null ? [] : ([{ data: { action: policy } }] as unknown as Policy[])
|
||||
policy === null ? [] : ([{ data: { action: policy } }] as unknown as Policy[]),
|
||||
);
|
||||
stateService.getVaultTimeoutAction.mockResolvedValue(userPreference);
|
||||
|
||||
const result = await firstValueFrom(service.vaultTimeoutAction$());
|
||||
|
||||
expect(result).toBe(expected);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ export class VaultTimeoutSettingsService implements VaultTimeoutSettingsServiceA
|
||||
private tokenService: TokenService,
|
||||
private policyService: PolicyService,
|
||||
private stateService: StateService,
|
||||
private userVerificationService: UserVerificationService
|
||||
private userVerificationService: UserVerificationService,
|
||||
) {}
|
||||
|
||||
async setVaultTimeoutOptions(timeout: number, action: VaultTimeoutAction): Promise<void> {
|
||||
|
||||
@@ -74,7 +74,7 @@ describe("VaultTimeoutService", () => {
|
||||
authService,
|
||||
vaultTimeoutSettingsService,
|
||||
lockedCallback,
|
||||
loggedOutCallback
|
||||
loggedOutCallback,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -91,7 +91,7 @@ describe("VaultTimeoutService", () => {
|
||||
availableTimeoutActions?: VaultTimeoutAction[];
|
||||
}
|
||||
>,
|
||||
userId?: string
|
||||
userId?: string,
|
||||
) => {
|
||||
// Both are available by default and the specific test can change this per test
|
||||
availableVaultTimeoutActionsSubject.next([VaultTimeoutAction.Lock, VaultTimeoutAction.LogOut]);
|
||||
@@ -123,7 +123,7 @@ describe("VaultTimeoutService", () => {
|
||||
accounts[userId]?.availableTimeoutActions ?? [
|
||||
VaultTimeoutAction.Lock,
|
||||
VaultTimeoutAction.LogOut,
|
||||
]
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
@@ -133,7 +133,7 @@ describe("VaultTimeoutService", () => {
|
||||
newPartial[key] = null; // No values actually matter on this other than the key
|
||||
return Object.assign(agg, newPartial);
|
||||
},
|
||||
{} as Record<string, Account>
|
||||
{} as Record<string, Account>,
|
||||
);
|
||||
accountsSubject.next(accountsSubjectValue);
|
||||
};
|
||||
@@ -172,7 +172,7 @@ describe("VaultTimeoutService", () => {
|
||||
});
|
||||
|
||||
expectNoAction("1");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
@@ -195,7 +195,7 @@ describe("VaultTimeoutService", () => {
|
||||
await vaultTimeoutService.checkVaultTimeout();
|
||||
|
||||
expectNoAction("1");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it.each([undefined, null])(
|
||||
@@ -212,7 +212,7 @@ describe("VaultTimeoutService", () => {
|
||||
await vaultTimeoutService.checkVaultTimeout();
|
||||
|
||||
expectNoAction("1");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("should lock an account that isn't active and has immediate as their timeout when view is not open", async () => {
|
||||
@@ -276,7 +276,7 @@ describe("VaultTimeoutService", () => {
|
||||
availableTimeoutActions: [VaultTimeoutAction.LogOut],
|
||||
},
|
||||
},
|
||||
"2" // Treat user 2 as the active user
|
||||
"2", // Treat user 2 as the active user
|
||||
);
|
||||
|
||||
await vaultTimeoutService.checkVaultTimeout();
|
||||
|
||||
@@ -30,7 +30,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction {
|
||||
private authService: AuthService,
|
||||
private vaultTimeoutSettingsService: VaultTimeoutSettingsService,
|
||||
private lockedCallback: (userId?: string) => Promise<void> = null,
|
||||
private loggedOutCallback: (expired: boolean, userId?: string) => Promise<void> = null
|
||||
private loggedOutCallback: (expired: boolean, userId?: string) => Promise<void> = null,
|
||||
) {}
|
||||
|
||||
async init(checkOnInterval: boolean) {
|
||||
@@ -71,7 +71,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction {
|
||||
}
|
||||
|
||||
const availableActions = await firstValueFrom(
|
||||
this.vaultTimeoutSettingsService.availableVaultTimeoutActions$(userId)
|
||||
this.vaultTimeoutSettingsService.availableVaultTimeoutActions$(userId),
|
||||
);
|
||||
const supportsLock = availableActions.includes(VaultTimeoutAction.Lock);
|
||||
if (!supportsLock) {
|
||||
@@ -134,7 +134,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction {
|
||||
|
||||
private async executeTimeoutAction(userId: string): Promise<void> {
|
||||
const timeoutAction = await firstValueFrom(
|
||||
this.vaultTimeoutSettingsService.vaultTimeoutAction$(userId)
|
||||
this.vaultTimeoutSettingsService.vaultTimeoutAction$(userId),
|
||||
);
|
||||
timeoutAction === VaultTimeoutAction.LogOut
|
||||
? await this.logOut(userId)
|
||||
|
||||
Reference in New Issue
Block a user