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';
|
2024-08-17 22:11:46 +03:00
|
|
|
import configureStore from '../../../src/devpanel/store/panelStore';
|
2022-10-10 20:05:28 +03:00
|
|
|
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" />
|
2023-07-12 21:03:20 +03:00
|
|
|
</Provider>,
|
2021-10-22 17:49:53 +03:00
|
|
|
);
|
|
|
|
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" />
|
2023-07-12 21:03:20 +03:00
|
|
|
</Provider>,
|
2020-10-26 15:18:23 +03:00
|
|
|
);
|
2021-10-22 17:49:53 +03:00
|
|
|
const actionList = screen.getByTestId('actionList');
|
2023-08-19 02:52:43 +03:00
|
|
|
expect(within(actionList).queryByRole('button')).not.toBeInTheDocument();
|
2020-10-26 15:18:23 +03:00
|
|
|
});
|
|
|
|
});
|