Skip to content

Commit

Permalink
fix(build): fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lailabjil committed Dec 12, 2023
1 parent 2039f26 commit e3d1727
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down

0 comments on commit e3d1727

Please sign in to comment.