From 7d4c665b54ee1ff8149510d61b59eac81511ba22 Mon Sep 17 00:00:00 2001 From: Hinton Date: Tue, 19 Apr 2022 13:24:04 +0200 Subject: [PATCH] Fix tests --- common/spec/importers/bitwardenJsonImporter.spec.ts | 5 ++++- .../bitwardenPasswordProtectedImporter.spec.ts | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/common/spec/importers/bitwardenJsonImporter.spec.ts b/common/spec/importers/bitwardenJsonImporter.spec.ts index 94b03528..8f4d418b 100644 --- a/common/spec/importers/bitwardenJsonImporter.spec.ts +++ b/common/spec/importers/bitwardenJsonImporter.spec.ts @@ -1,6 +1,7 @@ import { Substitute, SubstituteOf } from "@fluffy-spoon/substitute"; import { CryptoService } from "jslib-common/abstractions/crypto.service"; +import { FolderService } from "jslib-common/abstractions/folder.service"; import { I18nService } from "jslib-common/abstractions/i18n.service"; import { BitwardenJsonImporter } from "jslib-common/importers/bitwardenJsonImporter"; @@ -10,12 +11,14 @@ describe("bitwarden json importer", () => { let sut: BitwardenJsonImporter; let cryptoService: SubstituteOf; let i18nService: SubstituteOf; + let folderService: SubstituteOf; beforeEach(() => { cryptoService = Substitute.for(); i18nService = Substitute.for(); + folderService = Substitute.for(); - sut = new BitwardenJsonImporter(cryptoService, i18nService); + sut = new BitwardenJsonImporter(cryptoService, i18nService, folderService); }); it("should fail if password is needed", async () => { diff --git a/common/spec/importers/bitwardenPasswordProtectedImporter.spec.ts b/common/spec/importers/bitwardenPasswordProtectedImporter.spec.ts index ed2434ee..c6a253f9 100644 --- a/common/spec/importers/bitwardenPasswordProtectedImporter.spec.ts +++ b/common/spec/importers/bitwardenPasswordProtectedImporter.spec.ts @@ -1,6 +1,7 @@ import Substitute, { Arg, SubstituteOf } from "@fluffy-spoon/substitute"; import { CryptoService } from "jslib-common/abstractions/crypto.service"; +import { FolderService } from "jslib-common/abstractions/folder.service"; import { I18nService } from "jslib-common/abstractions/i18n.service"; import { KdfType } from "jslib-common/enums/kdfType"; import { BitwardenPasswordProtectedImporter } from "jslib-common/importers/bitwardenPasswordProtectedImporter"; @@ -13,6 +14,7 @@ describe("BitwardenPasswordProtectedImporter", () => { let importer: BitwardenPasswordProtectedImporter; let cryptoService: SubstituteOf; let i18nService: SubstituteOf; + let folderService: SubstituteOf; const password = Utils.newGuid(); const result = new ImportResult(); let jDoc: { @@ -28,6 +30,7 @@ describe("BitwardenPasswordProtectedImporter", () => { beforeEach(() => { cryptoService = Substitute.for(); i18nService = Substitute.for(); + folderService = Substitute.for(); jDoc = { encrypted: true, @@ -40,7 +43,12 @@ describe("BitwardenPasswordProtectedImporter", () => { }; result.success = true; - importer = new BitwardenPasswordProtectedImporter(cryptoService, i18nService, password); + importer = new BitwardenPasswordProtectedImporter( + cryptoService, + i18nService, + folderService, + password + ); }); describe("Required Json Data", () => {