Skip to content

Commit

Permalink
simpler without fake timerz
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Aug 30, 2021
1 parent b871afb commit 3f5ec1d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { createSingleSearchResponse } from '../../../../test/mock/createAPIResponse';
import { createSearchClient } from '../../../../test/mock/createSearchClient';
import { castToJestMock } from '../../../../test/utils/castToJestMock';
import { wait } from '../../../../test/utils/wait';

describe('connectRefinementList', () => {
const createWidgetFactory = () => {
Expand Down Expand Up @@ -1068,7 +1069,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/refinement-

// `searchForItems` triggers a new render
renderingOptions2.searchForItems('query triggering no results');
await Promise.resolve();
await wait(0);

expect(helper.searchForFacetValues).toHaveBeenCalledWith(
expect.anything(),
Expand Down Expand Up @@ -1102,7 +1103,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/refinement-

// `searchForItems` triggers a new render
renderingOptions3.searchForItems('');
await Promise.resolve();
await wait(0);

expect(rendering).toHaveBeenCalledTimes(4);
const renderingOptions4 = rendering.mock.calls[3][0];
Expand Down
Loading

0 comments on commit 3f5ec1d

Please sign in to comment.