Skip to content

Commit

Permalink
Block Editor: Mock useSelect by relative file import
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jan 16, 2020
1 parent 05aefa3 commit d66a4ce
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/block-editor/src/components/link-control/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@ import { fauxEntitySuggestions, fetchFauxEntitySuggestions } from './fixtures';

const mockFetchSearchSuggestions = jest.fn();

jest.mock( '@wordpress/data', () => {
return {
...require.requireActual( '../../../../../data' ),
useSelect() {
return {
fetchSearchSuggestions: mockFetchSearchSuggestions,
};
},
};
} );
jest.mock( '@wordpress/data/src/components/use-select', () => () => ( {
fetchSearchSuggestions: mockFetchSearchSuggestions,
} ) );

/**
* Wait for next tick of event loop. This is required
Expand Down

0 comments on commit d66a4ce

Please sign in to comment.