Skip to content

Commit

Permalink
comment: explain await null
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkvon committed Dec 16, 2018
1 parent 2ec9191 commit 2a72c4a
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Enzyme.configure({ adapter: new Adapter() });
const wrapper = shallow(<ReferencesNew userFrom={userFrom} userTo={userTo} />);

expect(wrapper.find(Duplicate)).not.toExist();
await null;
await null; // wait for the next tick (resolve stubbed API call)
expect(wrapper.find(Duplicate)).toExist();
expect(wrapper.find(Interaction)).not.toExist();
});
Expand All @@ -76,7 +76,7 @@ Enzyme.configure({ adapter: new Adapter() });

const wrapper = shallow(<ReferencesNew userFrom={userFrom} userTo={userTo} />);
expect(wrapper.find(Interaction)).not.toExist();
await null;
await null; // wait for the next tick (resolve stubbed API call)
expect(wrapper.find(Interaction)).toExist();
});

Expand All @@ -89,7 +89,7 @@ Enzyme.configure({ adapter: new Adapter() });

const wrapper = shallow(<ReferencesNew userFrom={userFrom} userTo={userTo} />);

await null;
await null; // wait for the next tick (resolve stubbed API call)

expect(spyCreate.callCount).toBe(0);
wrapper.setState({
Expand Down Expand Up @@ -124,7 +124,7 @@ Enzyme.configure({ adapter: new Adapter() });

const wrapper = shallow(<ReferencesNew userFrom={userFrom} userTo={userTo} />);

await null;
await null; // wait for the next tick (resolve stubbed API call)

expect(spyReport.callCount).toBe(0);
wrapper.setState({
Expand All @@ -140,7 +140,7 @@ Enzyme.configure({ adapter: new Adapter() });

nav.props().onSubmit();

await null;
await null; // wait for the next tick (resolve stubbed API call)

expect(spyReport.callCount).toBe(0);

Expand All @@ -153,7 +153,7 @@ Enzyme.configure({ adapter: new Adapter() });

nav.props().onSubmit();

await null;
await null; // wait for the next tick (resolve stubbed API call)

expect(spyReport.callCount).toBe(1);
expect(spyReport.calledOnceWith(userTo, 'asdf')).toBe(true);
Expand Down

0 comments on commit 2a72c4a

Please sign in to comment.