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';
|
2022-10-10 20:05:28 +03:00
|
|
|
import configureStore from '../../../src/window/store/windowStore';
|
|
|
|
import App from '../../../src/app/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(),
|
|
|
|
})),
|
|
|
|
});
|
|
|
|
|
2022-10-10 02:36:16 +03:00
|
|
|
const { store } = configureStore();
|
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
|
|
|
});
|
|
|
|
});
|