mirror of
https://github.com/bitwarden/browser
synced 2026-02-07 20:24:01 +00:00
fix unit tests
This commit is contained in:
@@ -121,7 +121,6 @@ describe("RemovePasswordComponent", () => {
|
||||
|
||||
expect(component.continuing).toBe(true);
|
||||
expect(mockKeyConnectorService.migrateUser).toHaveBeenCalledWith(userId);
|
||||
expect(mockKeyConnectorService.removeConvertAccountRequired).toHaveBeenCalledWith(userId);
|
||||
expect(mockToastService.showToast).toHaveBeenCalledWith({
|
||||
variant: "success",
|
||||
message: "removed master password",
|
||||
@@ -143,7 +142,6 @@ describe("RemovePasswordComponent", () => {
|
||||
title: "error occurred",
|
||||
message: errorMessage,
|
||||
});
|
||||
expect(mockKeyConnectorService.removeConvertAccountRequired).not.toHaveBeenCalled();
|
||||
expect(mockRouter.navigate).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -168,7 +166,6 @@ describe("RemovePasswordComponent", () => {
|
||||
title: "error occurred",
|
||||
message: errorMessage,
|
||||
});
|
||||
expect(mockKeyConnectorService.removeConvertAccountRequired).not.toHaveBeenCalled();
|
||||
expect(mockRouter.navigate).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -192,7 +189,6 @@ describe("RemovePasswordComponent", () => {
|
||||
variant: "success",
|
||||
message: "left organization",
|
||||
});
|
||||
expect(mockKeyConnectorService.removeConvertAccountRequired).toHaveBeenCalledWith(userId);
|
||||
expect(mockRouter.navigate).toHaveBeenCalledWith([""]);
|
||||
});
|
||||
|
||||
@@ -211,7 +207,6 @@ describe("RemovePasswordComponent", () => {
|
||||
title: "error occurred",
|
||||
message: errorMessage,
|
||||
});
|
||||
expect(mockKeyConnectorService.removeConvertAccountRequired).not.toHaveBeenCalled();
|
||||
expect(mockRouter.navigate).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -237,7 +232,6 @@ describe("RemovePasswordComponent", () => {
|
||||
title: "error occurred",
|
||||
message: errorMessage,
|
||||
});
|
||||
expect(mockKeyConnectorService.removeConvertAccountRequired).not.toHaveBeenCalled();
|
||||
expect(mockRouter.navigate).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -248,7 +242,6 @@ describe("RemovePasswordComponent", () => {
|
||||
|
||||
expect(component.leaving).toBe(false);
|
||||
expect(mockOrganizationApiService.leave).not.toHaveBeenCalled();
|
||||
expect(mockKeyConnectorService.removeConvertAccountRequired).not.toHaveBeenCalled();
|
||||
expect(mockRouter.navigate).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ import { TestBed } from "@angular/core/testing";
|
||||
import { Router } from "@angular/router";
|
||||
import { RouterTestingModule } from "@angular/router/testing";
|
||||
import { MockProxy, mock } from "jest-mock-extended";
|
||||
import { BehaviorSubject } from "rxjs";
|
||||
import { BehaviorSubject, of } from "rxjs";
|
||||
|
||||
import { EmptyComponent } from "@bitwarden/angular/platform/guard/feature-flag.guard.spec";
|
||||
import {
|
||||
@@ -30,9 +30,7 @@ describe("AuthGuard", () => {
|
||||
authService.getAuthStatus.mockResolvedValue(authStatus);
|
||||
const messagingService: MockProxy<MessagingService> = mock<MessagingService>();
|
||||
const keyConnectorService: MockProxy<KeyConnectorService> = mock<KeyConnectorService>();
|
||||
keyConnectorService.getConvertAccountRequired.mockResolvedValue(
|
||||
keyConnectorServiceRequiresAccountConversion,
|
||||
);
|
||||
keyConnectorService.convertAccountRequired$ = of(keyConnectorServiceRequiresAccountConversion);
|
||||
const accountService: MockProxy<AccountService> = mock<AccountService>();
|
||||
const activeAccountSubject = new BehaviorSubject<Account | null>(null);
|
||||
accountService.activeAccount$ = activeAccountSubject;
|
||||
|
||||
Reference in New Issue
Block a user