Skip to content

Commit

Permalink
PM-8113 - TwoFactorAuth - Clean up unused stuff and get tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredSnider-Bitwarden committed Jan 24, 2025
1 parent 314c1a2 commit 8506449
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { Component } from "@angular/core";
import { ComponentFixture, TestBed } from "@angular/core/testing";
import { ActivatedRoute, convertToParamMap, Router } from "@angular/router";
Expand Down Expand Up @@ -27,7 +29,6 @@ import { FakeMasterPasswordService } from "@bitwarden/common/auth/services/maste
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
import { SyncService } from "@bitwarden/common/platform/sync";
Expand Down Expand Up @@ -68,7 +69,6 @@ describe("TwoFactorComponent", () => {
let mockToastService: MockProxy<ToastService>;
let mockTwoFactorAuthCompService: MockProxy<TwoFactorAuthComponentService>;
let mockSyncService: MockProxy<SyncService>;
let mockMessagingService: MockProxy<MessagingService>;

let mockUserDecryptionOpts: {
noMasterPassword: UserDecryptionOptions;
Expand Down Expand Up @@ -103,8 +103,9 @@ describe("TwoFactorComponent", () => {
mockDialogService = mock<DialogService>();
mockToastService = mock<ToastService>();
mockTwoFactorAuthCompService = mock<TwoFactorAuthComponentService>();
mockTwoFactorAuthCompService.handle2faSuccess = undefined;

mockSyncService = mock<SyncService>();
mockMessagingService = mock<MessagingService>();

mockUserDecryptionOpts = {
noMasterPassword: new UserDecryptionOptions({
Expand Down Expand Up @@ -149,7 +150,7 @@ describe("TwoFactorComponent", () => {
}),
};

selectedUserDecryptionOptions = new BehaviorSubject<UserDecryptionOptions>(null);
selectedUserDecryptionOptions = new BehaviorSubject<UserDecryptionOptions>(undefined);
mockUserDecryptionOptionsService.userDecryptionOptions$ = selectedUserDecryptionOptions;

TestBed.configureTestingModule({
Expand Down Expand Up @@ -186,7 +187,6 @@ describe("TwoFactorComponent", () => {
{ provide: ToastService, useValue: mockToastService },
{ provide: TwoFactorAuthComponentService, useValue: mockTwoFactorAuthCompService },
{ provide: SyncService, useValue: mockSyncService },
{ provide: MessagingService, useValue: mockMessagingService },
],
});

Expand Down Expand Up @@ -260,7 +260,6 @@ describe("TwoFactorComponent", () => {
// Assert
expect(mockLoginStrategyService.logInTwoFactor).toHaveBeenCalledWith(
new TokenTwoFactorRequest(component.selectedProviderType, token, remember),
null, // captcha token not supported
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { TokenTwoFactorRequest } from "@bitwarden/common/auth/models/request/ide
import { TwoFactorProviders } from "@bitwarden/common/auth/services/two-factor.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { SyncService } from "@bitwarden/common/platform/sync";
import {
Expand Down Expand Up @@ -134,7 +133,6 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy {
private toastService: ToastService,
private twoFactorAuthComponentService: TwoFactorAuthComponentService,
private syncService: SyncService,
private messagingService: MessagingService,
private destroyRef: DestroyRef,
) {}

Expand Down

0 comments on commit 8506449

Please sign in to comment.