2019-01-03 16:00:55 +03:00
|
|
|
import React from 'react';
|
2021-10-22 07:18:03 +03:00
|
|
|
import { render } from '@testing-library/react';
|
2019-01-03 16:00:55 +03:00
|
|
|
import { Container } from '../src';
|
|
|
|
|
2021-11-06 20:28:35 +03:00
|
|
|
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(),
|
|
|
|
})),
|
|
|
|
});
|
|
|
|
|
2020-08-08 23:26:39 +03:00
|
|
|
describe('Container', function () {
|
2019-01-03 16:00:55 +03:00
|
|
|
it('renders correctly', () => {
|
2021-10-22 07:18:03 +03:00
|
|
|
const { container } = render(
|
2019-01-10 21:51:14 +03:00
|
|
|
<Container
|
2021-11-06 20:28:35 +03:00
|
|
|
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>
|
|
|
|
);
|
2021-10-22 07:18:03 +03:00
|
|
|
expect(container.firstChild).toMatchSnapshot();
|
2019-01-03 16:00:55 +03:00
|
|
|
});
|
|
|
|
});
|