test fixup

This commit is contained in:
Jake McDermott
2019-01-02 02:28:24 -05:00
parent 8f4437e17e
commit 31d0347553
7 changed files with 108 additions and 141 deletions

View File

@@ -4,7 +4,7 @@ import { HashRouter as Router } from 'react-router-dom';
import { shallow, mount } from 'enzyme';
import App from '../src/App';
import api from '../src/api';
import { API_LOGOUT, API_CONFIG } from '../src/endpoints';
import { API_LOGOUT } from '../src/endpoints';
import Dashboard from '../src/pages/Dashboard';
import { asyncFlush } from '../jest.setup';
@@ -45,6 +45,7 @@ describe('<App />', () => {
const appWrapper = shallow(<App />);
appWrapper.instance().onDevLogout();
appWrapper.setState({ activeGroup: 'foo', activeItem: 'bar' });
expect(api.get).toHaveBeenCalledTimes(1);
expect(api.get).toHaveBeenCalledWith(API_LOGOUT);
await asyncFlush();
expect(appWrapper.state().activeItem).toBe(DEFAULT_ACTIVE_ITEM);