Fix broken export spec (#5152)

This commit is contained in:
Oscar Hinton 2023-04-03 12:26:11 +02:00 committed by GitHub
parent 7f34abfead
commit a68631c7b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import { Arg, Substitute, SubstituteOf } from "@fluffy-spoon/substitute";
import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service"; import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
import { CryptoFunctionService } from "@bitwarden/common/abstractions/cryptoFunction.service"; import { CryptoFunctionService } from "@bitwarden/common/abstractions/cryptoFunction.service";
import { KdfConfig } from "@bitwarden/common/auth/models/domain/kdf-config";
import { KdfType, DEFAULT_PBKDF2_ITERATIONS } from "@bitwarden/common/enums/kdfType"; import { KdfType, DEFAULT_PBKDF2_ITERATIONS } from "@bitwarden/common/enums/kdfType";
import { Utils } from "@bitwarden/common/misc/utils"; import { Utils } from "@bitwarden/common/misc/utils";
import { EncString } from "@bitwarden/common/models/domain/enc-string"; import { EncString } from "@bitwarden/common/models/domain/enc-string";
@ -153,9 +154,12 @@ describe("ExportService", () => {
cipherService = Substitute.for<CipherService>(); cipherService = Substitute.for<CipherService>();
folderService = Substitute.for<FolderService>(); folderService = Substitute.for<FolderService>();
cryptoService = Substitute.for<CryptoService>(); cryptoService = Substitute.for<CryptoService>();
stateService = Substitute.for<StateService>();
folderService.getAllDecryptedFromState().resolves(UserFolderViews); folderService.getAllDecryptedFromState().resolves(UserFolderViews);
folderService.getAllFromState().resolves(UserFolders); folderService.getAllFromState().resolves(UserFolders);
stateService.getKdfType().resolves(KdfType.PBKDF2_SHA256);
stateService.getKdfConfig().resolves(new KdfConfig(DEFAULT_PBKDF2_ITERATIONS));
exportService = new ExportService( exportService = new ExportService(
folderService, folderService,