mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-12 13:39:14 +01:00
[PM-18659] Remove console logs from importers unit tests (#13583)
* Remove console logs from importers unit tests * Add fixme
This commit is contained in:
parent
a7a5a2771e
commit
325fdc3f3a
@ -20,6 +20,7 @@ import { ImportResult } from "../models/import-result";
|
||||
export abstract class BaseImporter {
|
||||
organizationId: string = null;
|
||||
|
||||
// FIXME: This should be replaced by injecting the log service.
|
||||
protected logService: LogService = new ConsoleLogService(false);
|
||||
|
||||
protected newLineRegex = /(?:\r\n|\r|\n)/;
|
||||
|
@ -48,6 +48,8 @@ describe("PasswordXPCsvImporter", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
importer = new PasswordXPCsvImporter();
|
||||
// Importers currently create their own ConsoleLogService. This should be replaced by injecting a test log service.
|
||||
jest.spyOn(console, "warn").mockImplementation();
|
||||
});
|
||||
|
||||
it("should return success false if CSV data is null", async () => {
|
||||
|
@ -5,6 +5,11 @@ import { data as dataNoFolder } from "./spec-data/roboform-csv/empty-folders";
|
||||
import { data as dataFolder } from "./spec-data/roboform-csv/with-folders";
|
||||
|
||||
describe("Roboform CSV Importer", () => {
|
||||
beforeEach(() => {
|
||||
// Importers currently create their own ConsoleLogService. This should be replaced by injecting a test log service.
|
||||
jest.spyOn(console, "warn").mockImplementation();
|
||||
});
|
||||
|
||||
it("should parse CSV data", async () => {
|
||||
const importer = new RoboFormCsvImporter();
|
||||
const result = await importer.parse(dataNoFolder);
|
||||
|
@ -51,6 +51,11 @@ const CipherData = [
|
||||
];
|
||||
|
||||
describe("SecureSafe CSV Importer", () => {
|
||||
beforeEach(() => {
|
||||
// Importers currently create their own ConsoleLogService. This should be replaced by injecting a test log service.
|
||||
jest.spyOn(console, "warn").mockImplementation();
|
||||
});
|
||||
|
||||
CipherData.forEach((data) => {
|
||||
it(data.title, async () => {
|
||||
const importer = new SecureSafeCsvImporter();
|
||||
|
Loading…
Reference in New Issue
Block a user