Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Jun 21, 2023
1 parent a73cbf5 commit 0265bc0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const SELECT_NAVIGATION_MENUS_ARGS = [
'postType',
'wp_navigation',
{
per_page: -1,
per_page: 100,
status: [ 'publish', 'draft' ],
order: 'desc',
orderby: 'date',
Expand Down
23 changes: 12 additions & 11 deletions packages/block-library/src/navigation/test/use-navigation-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { store as coreStore } from '@wordpress/core-data';
* Internal dependencies
*/
import useNavigationMenu from '../use-navigation-menu';
import { SELECT_NAVIGATION_MENUS_ARGS } from '../constants';

function createRegistryWithStores() {
// Create a registry and register used stores.
Expand All @@ -33,19 +34,19 @@ jest.mock( '@wordpress/data/src/components/use-select', () => {

function resolveRecords( registry, menus ) {
const dispatch = registry.dispatch( coreStore );
dispatch.startResolution( 'getEntityRecords', [
'postType',
'wp_navigation',
{ per_page: -1, status: [ 'publish', 'draft' ] },
] );
dispatch.finishResolution( 'getEntityRecords', [
'postType',
'wp_navigation',
{ per_page: -1, status: [ 'publish', 'draft' ] },
] );
dispatch.startResolution(
'getEntityRecords',
SELECT_NAVIGATION_MENUS_ARGS
);
dispatch.finishResolution(
'getEntityRecords',
SELECT_NAVIGATION_MENUS_ARGS
);
dispatch.receiveEntityRecords( 'postType', 'wp_navigation', menus, {
per_page: -1,
per_page: 100,
status: [ 'publish', 'draft' ],
order: 'desc',
orderby: 'date',
} );
}

Expand Down

0 comments on commit 0265bc0

Please sign in to comment.