redux-devtools/packages/redux-devtools-ui/test/Container.test.tsx

35 lines
840 B
TypeScript
Raw Permalink Normal View History

2019-01-03 16:00:55 +03:00
import React from 'react';
import { render } from '@testing-library/react';
2019-01-03 16:00:55 +03:00
import { Container } from '../src';
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(),
})),
});
describe('Container', function () {
2019-01-03 16:00:55 +03:00
it('renders correctly', () => {
const { container } = render(
2019-01-10 21:51:14 +03:00
<Container
themeData={{
theme: 'default',
scheme: 'default',
colorPreference: 'auto',
}}
2019-01-10 21:51:14 +03:00
>
2019-01-03 16:00:55 +03:00
Text
</Container>,
2019-01-03 16:00:55 +03:00
);
expect(container.firstChild).toMatchSnapshot();
2019-01-03 16:00:55 +03:00
});
});