Dashboard.test.js 366 Bytes
Newer Older
偏右's avatar
偏右 committed
1 2 3 4 5
import React from 'react';
import { shallow } from 'enzyme';
import Dashboard from './Dashboard';

it('renders Dashboard', () => {
afc163's avatar
afc163 committed
6
  const fetchFn = jest.fn();
偏右's avatar
偏右 committed
7
  const wrapper = shallow(
afc163's avatar
afc163 committed
8
    <Dashboard.WrappedComponent user={{ list: [] }} dispatch={fetchFn} />
偏右's avatar
偏右 committed
9 10
  );
  expect(wrapper.find('Table').props().dataSource).toEqual([]);
afc163's avatar
afc163 committed
11
  expect(fetchFn).toBeCalled();
偏右's avatar
偏右 committed
12
});