Commit 12f41ad8 authored by afc163's avatar afc163

upgrade enzyme

parent c6e28e66
......@@ -6,6 +6,7 @@
"node": true,
"es6": true,
"mocha": true,
"jest": true,
"jasmine": true
},
"rules": {
......
......@@ -3,8 +3,10 @@ import { shallow } from 'enzyme';
import Dashboard from './Dashboard';
it('renders Dashboard', () => {
const fetchFn = jest.fn();
const wrapper = shallow(
<Dashboard.WrappedComponent user={{ list: [] }} />
<Dashboard.WrappedComponent user={{ list: [] }} dispatch={fetchFn} />
);
expect(wrapper.find('Table').props().dataSource).toEqual([]);
expect(fetchFn).toBeCalled();
});
import { jsdom } from 'jsdom';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-15';
Enzyme.configure({ adapter: new Adapter() });
// fixed jsdom miss
const documentHTML = '<!doctype html><html><body><div id="root"></div></body></html>';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment