score:0

import { apiCall } from '../api';
jest.mock('../api');
// ...

it('Contains a <Loading /> on loading', () => {
  // The promise won't be resolved so the loading state will persist
  apiCall.mockReturnValue(new Promise(() => null));

  // await act... and wrapper.update() might not be needed 
  // depending on your implementation
  await act(async () => {
    wrapper.find(SubmitButton).simulate('click');
  });
  wrapper.update();

  expect(wrapper.find(Loading)).toHaveLength(1);
});

Related Query

More Query from same tag