2022-07-26 03:40:32 +02:00
|
|
|
import { mock, mockReset } from "jest-mock-extended";
|
|
|
|
|
|
|
|
import { CryptoFunctionService } from "@bitwarden/common/abstractions/cryptoFunction.service";
|
2022-10-27 23:38:54 +02:00
|
|
|
import { EncryptService } from "@bitwarden/common/abstractions/encrypt.service";
|
2022-07-26 03:40:32 +02:00
|
|
|
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>();
|
2022-10-27 23:38:54 +02:00
|
|
|
const encryptService = mock<EncryptService>();
|
2022-07-26 03:40:32 +02:00
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|