1 import '@testing-library/jest-dom';
3 import '@proton/testing/lib/mockMatchMedia';
4 import '@proton/testing/lib/mockUnleash';
6 const { getComputedStyle } = window;
8 window.getComputedStyle = (elt) => getComputedStyle(elt);
9 window.ResizeObserver = jest.fn().mockImplementation(() => ({
12 disconnect: jest.fn(),
15 // Silence JDOM warnings triggered by emoji-mart
16 HTMLCanvasElement.prototype.getContext = jest.fn();
18 // JSDom does not include a full implementation of webcrypto
19 const crypto = require('crypto').webcrypto;
20 global.crypto.subtle = crypto.subtle;
22 jest.mock('@proton/shared/lib/i18n/dateFnLocales', () => ({
26 jest.mock('@proton/shared/lib/pow/wasmWorkerWrapper.ts', () => ({
30 jest.mock('@proton/shared/lib/pow/pbkdfWorkerWrapper.ts', () => ({
34 // Do not start crypto worker pool, let the single tests setup/mock the CryptoProxy as needed
35 jest.mock('@proton/shared/lib/helpers/setupCryptoWorker', () => ({
37 loadCryptoWorker: jest.fn(),