mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 19:23:19 +00:00
updated test cases and services using the config service
This commit is contained in:
@@ -30,7 +30,7 @@ describe("FidoAuthenticatorService", () => {
|
||||
authenticator = mock<Fido2AuthenticatorService>();
|
||||
configService = mock<ConfigServiceAbstraction>();
|
||||
client = new Fido2ClientService(authenticator, configService);
|
||||
configService.getFeatureFlagBool.mockResolvedValue(true);
|
||||
configService.getFeatureFlag.mockResolvedValue(true);
|
||||
});
|
||||
|
||||
describe("createCredential", () => {
|
||||
@@ -197,7 +197,7 @@ describe("FidoAuthenticatorService", () => {
|
||||
|
||||
it("should throw FallbackRequestedError if feature flag is not enabled", async () => {
|
||||
const params = createParams();
|
||||
configService.getFeatureFlagBool.mockResolvedValue(false);
|
||||
configService.getFeatureFlag.mockResolvedValue(false);
|
||||
|
||||
const result = async () => await client.createCredential(params);
|
||||
|
||||
@@ -335,7 +335,7 @@ describe("FidoAuthenticatorService", () => {
|
||||
|
||||
it("should throw FallbackRequestedError if feature flag is not enabled", async () => {
|
||||
const params = createParams();
|
||||
configService.getFeatureFlagBool.mockResolvedValue(false);
|
||||
configService.getFeatureFlag.mockResolvedValue(false);
|
||||
|
||||
const result = async () => await client.assertCredential(params);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ export class Fido2ClientService implements Fido2ClientServiceAbstraction {
|
||||
) {}
|
||||
|
||||
async isFido2FeatureEnabled(): Promise<boolean> {
|
||||
return await this.configService.getFeatureFlagBool(FeatureFlag.Fido2VaultCredentials);
|
||||
return await this.configService.getFeatureFlag<boolean>(FeatureFlag.Fido2VaultCredentials);
|
||||
}
|
||||
|
||||
async createCredential(
|
||||
|
||||
Reference in New Issue
Block a user