1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 22:13:32 +00:00

Revert changes to v1 components

This commit is contained in:
Alec Rippberger
2025-03-17 10:02:33 -05:00
parent 9f550915d0
commit 06273f3b2a
5 changed files with 2 additions and 66 deletions

View File

@@ -5,7 +5,6 @@ import { mock, MockProxy } from "jest-mock-extended";
import { BehaviorSubject } from "rxjs";
import { WINDOW } from "@bitwarden/angular/services/injection-tokens";
import { TwoFactorFormCacheService } from "@bitwarden/auth/angular";
import {
LoginStrategyServiceAbstraction,
LoginEmailServiceAbstraction,
@@ -73,7 +72,6 @@ describe("TwoFactorComponent", () => {
let mockMasterPasswordService: FakeMasterPasswordService;
let mockAccountService: FakeAccountService;
let mockToastService: MockProxy<ToastService>;
let mockTwoFactorFormCacheService: MockProxy<TwoFactorFormCacheService>;
let mockUserDecryptionOpts: {
noMasterPassword: UserDecryptionOptions;
@@ -110,11 +108,6 @@ describe("TwoFactorComponent", () => {
mockAccountService = mockAccountServiceWith(userId);
mockToastService = mock<ToastService>();
mockMasterPasswordService = new FakeMasterPasswordService();
mockTwoFactorFormCacheService = mock<TwoFactorFormCacheService>();
// Setup form cache service mock with necessary observables
mockTwoFactorFormCacheService.isEnabled$.mockReturnValue(new BehaviorSubject(false));
mockTwoFactorFormCacheService.formData$.mockReturnValue(new BehaviorSubject(null));
mockUserDecryptionOpts = {
noMasterPassword: new UserDecryptionOptions({
@@ -197,7 +190,6 @@ describe("TwoFactorComponent", () => {
{ provide: InternalMasterPasswordServiceAbstraction, useValue: mockMasterPasswordService },
{ provide: AccountService, useValue: mockAccountService },
{ provide: ToastService, useValue: mockToastService },
{ provide: TwoFactorFormCacheService, useValue: mockTwoFactorFormCacheService },
],
});

View File

@@ -7,7 +7,6 @@ import { firstValueFrom } from "rxjs";
import { first } from "rxjs/operators";
import { WINDOW } from "@bitwarden/angular/services/injection-tokens";
import { TwoFactorFormCacheService } from "@bitwarden/auth/angular";
import {
LoginStrategyServiceAbstraction,
LoginEmailServiceAbstraction,
@@ -100,7 +99,6 @@ export class TwoFactorComponentV1 extends CaptchaProtectedComponent implements O
protected masterPasswordService: InternalMasterPasswordServiceAbstraction,
protected accountService: AccountService,
protected toastService: ToastService,
protected twoFactorFormCacheService: TwoFactorFormCacheService,
) {
super(environmentService, i18nService, platformUtilsService, toastService);
@@ -439,10 +437,6 @@ export class TwoFactorComponentV1 extends CaptchaProtectedComponent implements O
return;
}
if ((await this.twoFactorFormCacheService.getFormData()).emailSent) {
return;
}
if ((await this.loginStrategyService.getEmail()) == null) {
this.toastService.showToast({
variant: "error",