2020-10-26 15:18:23 +03:00
|
|
|
import React from 'react';
|
2021-10-22 17:49:53 +03:00
|
|
|
import { render, screen, within } from '@testing-library/react';
|
2020-10-26 15:18:23 +03:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import configureStore from '../../../src/app/stores/windowStore';
|
2021-08-25 07:22:54 +03:00
|
|
|
import App from '../../../src/app/containers/App';
|
2020-10-26 15:18:23 +03:00
|
|
|
|
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(),
|
|
|
|
})),
|
|
|
|
});
|
|
|
|
|
2021-08-31 04:42:01 +03:00
|
|
|
const { store } = configureStore(store);
|
2020-10-26 15:18:23 +03:00
|
|
|
|
|
|
|
describe('App container', () => {
|
|
|
|
it("should render inspector monitor's component", () => {
|
2021-10-22 17:49:53 +03:00
|
|
|
render(
|
|
|
|
<Provider store={store}>
|
|
|
|
<App position="devtools-left" />
|
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
expect(screen.getByTestId('inspector')).toBeDefined();
|
2020-10-26 15:18:23 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should contain an empty action list', () => {
|
2021-10-22 17:49:53 +03:00
|
|
|
render(
|
|
|
|
<Provider store={store}>
|
|
|
|
<App position="devtools-left" />
|
|
|
|
</Provider>
|
2020-10-26 15:18:23 +03:00
|
|
|
);
|
2021-10-22 17:49:53 +03:00
|
|
|
const actionList = screen.getByTestId('actionList');
|
|
|
|
expect(
|
|
|
|
within(actionList).getByTestId('actionListRows')
|
|
|
|
).toBeEmptyDOMElement();
|
2020-10-26 15:18:23 +03:00
|
|
|
});
|
|
|
|
});
|