From c450fa7c7e26c8c6fc6abe359b5ab6ac87549ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Hassan?= Date: Thu, 25 Jul 2024 16:51:43 +0200 Subject: [PATCH] fix: unit test --- .../test/reference-grid.test.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/sn-controls-react/test/reference-grid.test.tsx b/packages/sn-controls-react/test/reference-grid.test.tsx index e7068ed77..b04d89e3d 100644 --- a/packages/sn-controls-react/test/reference-grid.test.tsx +++ b/packages/sn-controls-react/test/reference-grid.test.tsx @@ -1,3 +1,18 @@ +/* eslint-disable import/first */ +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(), + })), +}) + import Avatar from '@material-ui/core/Avatar' import Dialog from '@material-ui/core/Dialog' import IconButton from '@material-ui/core/IconButton'