mirror of
https://github.com/bitwarden/browser
synced 2024-12-22 16:12:07 +01:00
da47992a22
* Add item decryption to encryptService * Create multithreadEncryptService subclass to handle web workers * Create encryption web worker * Refactor cipherService to use new interface * Update dependencies
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { mock, mockReset } from "jest-mock-extended";
|
|
|
|
import { CryptoFunctionService } from "@bitwarden/common/abstractions/cryptoFunction.service";
|
|
import { EncryptService } from "@bitwarden/common/abstractions/encrypt.service";
|
|
import { LogService } from "@bitwarden/common/abstractions/log.service";
|
|
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
|
import { StateService } from "@bitwarden/common/abstractions/state.service";
|
|
import { CryptoService } from "@bitwarden/common/services/crypto.service";
|
|
|
|
describe("cryptoService", () => {
|
|
let cryptoService: CryptoService;
|
|
|
|
const cryptoFunctionService = mock<CryptoFunctionService>();
|
|
const encryptService = mock<EncryptService>();
|
|
const platformUtilService = mock<PlatformUtilsService>();
|
|
const logService = mock<LogService>();
|
|
const stateService = mock<StateService>();
|
|
|
|
beforeEach(() => {
|
|
mockReset(cryptoFunctionService);
|
|
mockReset(encryptService);
|
|
mockReset(platformUtilService);
|
|
mockReset(logService);
|
|
mockReset(stateService);
|
|
|
|
cryptoService = new CryptoService(
|
|
cryptoFunctionService,
|
|
encryptService,
|
|
platformUtilService,
|
|
logService,
|
|
stateService
|
|
);
|
|
});
|
|
|
|
it("instantiates", () => {
|
|
expect(cryptoService).not.toBeFalsy();
|
|
});
|
|
});
|