mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-05 06:09:57 -05:00
Updating react router usage to allow for testing.
This commit is contained in:
parent
373d460ba6
commit
df0e04bd83
4 changed files with 49 additions and 35 deletions
|
|
@ -2,6 +2,14 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import App from './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(),
|
||||
})),
|
||||
});
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(<App/>, div);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue