Skip to content

Commit d2220df

Browse files
committed
chore: fix tests
1 parent 5071770 commit d2220df

File tree

3 files changed

+3742
-0
lines changed

3 files changed

+3742
-0
lines changed

test/Storybook.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { act, render } from '@testing-library/react';
44
import * as glob from 'glob';
55
import path from 'path';
66
import './__mocks__/IntersectionObserverMock';
7+
import './__mocks__/matchMedia';
78

89
type StoryFile = {
910
default: Meta;

test/__mocks__/matchMedia.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
window.matchMedia = () => ( {
2+
matches : false, // All queries match the media string.
3+
media : '',
4+
onchange : null,
5+
addListener : jest.fn(),
6+
removeListener : jest.fn(),
7+
addEventListener : jest.fn(),
8+
removeEventListener: jest.fn(),
9+
dispatchEvent : jest.fn(),
10+
} as MediaQueryList );

0 commit comments

Comments
 (0)