From e3d17271b5ce60c84db4624a0f7287b5132ca439 Mon Sep 17 00:00:00 2001 From: "laila.abjil@keyconsulting.fr" Date: Tue, 12 Dec 2023 23:01:44 +0100 Subject: [PATCH] fix(build): fix test --- src/App.test.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/App.test.tsx b/src/App.test.tsx index 1ed5ef2e..b721ea09 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -13,6 +13,21 @@ jest.mock("oidc-react", () => ({ }, })); + +Object.defineProperty(window, "matchMedia", { + writable: true, + value: jest.fn().mockImplementation(query => ({ + matches: false, + media: query, + onchange: null, + addListener: jest.fn(), // Deprecated + removeListener: jest.fn(), // Deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), + })), +}); + jest.mock("react-i18next", () => ({ // this mock makes sure any components using the translate hook can use it without a warning being shown useTranslation: () => {