Advertisement
Guest User

Untitled

a guest
Feb 12th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import React from 'react';
  2. import Enzyme, { mount } from 'enzyme';
  3. import Adapter from 'enzyme-adapter-react-16';
  4. import { SimpleComponent } from './SimpleComponent';
  5.  
  6. const getMenuMock = jest.fn();
  7.  
  8. Enzyme.configure({ adapter: new Adapter() });
  9.  
  10. describe('SimpleComponent', () => {
  11. it('async call getMenu is resolved', async () => {
  12. getMenuMock.mockReturnValue(Promise.resolve())
  13. const wrapper = mount(<SimpleComponent getMenu={getMenuMock}/>);
  14. await Promise.resolve();
  15. expect(wrapper.state().isLoading).toBe(true);
  16. })
  17. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement