mirror of
				https://github.com/reduxjs/redux-devtools.git
				synced 2025-10-31 16:07:45 +03:00 
			
		
		
		
	* Move background to top-level * Move devpanel to top-level * Move devtools to top-level * Move options to top-level * Move window to top-level * Move chromeApiMock to top-level * Move manifests to top-level * Move contentScript to top-level * Move pageScript to top-level * Update tests * Update Webpack config * Fix path
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import React from 'react';
 | |
| import { render, screen, within } from '@testing-library/react';
 | |
| import { Provider } from 'react-redux';
 | |
| import configureStore from '../../../src/window/store/windowStore';
 | |
| import App from '../../../src/app/App';
 | |
| 
 | |
| 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(),
 | |
|   })),
 | |
| });
 | |
| 
 | |
| const { store } = configureStore();
 | |
| 
 | |
| describe('App container', () => {
 | |
|   it("should render inspector monitor's component", () => {
 | |
|     render(
 | |
|       <Provider store={store}>
 | |
|         <App position="devtools-left" />
 | |
|       </Provider>
 | |
|     );
 | |
|     expect(screen.getByTestId('inspector')).toBeDefined();
 | |
|   });
 | |
| 
 | |
|   it('should contain an empty action list', () => {
 | |
|     render(
 | |
|       <Provider store={store}>
 | |
|         <App position="devtools-left" />
 | |
|       </Provider>
 | |
|     );
 | |
|     const actionList = screen.getByTestId('actionList');
 | |
|     expect(
 | |
|       within(actionList).getByTestId('actionListRows')
 | |
|     ).toBeEmptyDOMElement();
 | |
|   });
 | |
| });
 |