Skip to content

Commit

Permalink
Merge pull request #5800 from marmelab/fix-use-query-with-store-flaky…
Browse files Browse the repository at this point in the history
…-test

Fix useQueryWithStore Flaky Test
  • Loading branch information
fzaninotto authored Jan 20, 2021
2 parents baaf3da + f596157 commit b97ffd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ra-core/src/dataProvider/useQueryWithStore.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ describe('useQueryWithStore', () => {
},
}
);
await new Promise(resolve => setImmediate(resolve)); // dataProvider Promise returns result on next tick
await new Promise(resolve => setTimeout(resolve, 100)); // dataProvider Promise returns result on next tick
expect(dataProvider.getOne).toBeCalledTimes(1);
dispatch({ type: 'RA/REFRESH_VIEW' });
await new Promise(resolve => setImmediate(resolve)); // dataProvider Promise returns result on next tick
await new Promise(resolve => setTimeout(resolve, 100)); // dataProvider Promise returns result on next tick
expect(dataProvider.getOne).toBeCalledTimes(2);
});

Expand Down

0 comments on commit b97ffd9

Please sign in to comment.