1
0
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:
Oscar Hinton 2025-03-03 16:59:50 +01:00 committed by GitHub
parent a7a5a2771e
commit 325fdc3f3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 0 deletions

View File

@ -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)/;

View File

@ -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 () => {

View File

@ -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);

View File

@ -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();