From 0f358b320024e3f802040d5bf31118b65d932c5b Mon Sep 17 00:00:00 2001 From: scruffian Date: Wed, 21 Jun 2023 11:03:44 +0100 Subject: [PATCH] remove the abstraction for tests --- .../navigation/test/use-navigation-menu.js | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/block-library/src/navigation/test/use-navigation-menu.js b/packages/block-library/src/navigation/test/use-navigation-menu.js index 3c29479efbc3f..f82acca835884 100644 --- a/packages/block-library/src/navigation/test/use-navigation-menu.js +++ b/packages/block-library/src/navigation/test/use-navigation-menu.js @@ -8,7 +8,6 @@ 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. @@ -34,14 +33,26 @@ jest.mock( '@wordpress/data/src/components/use-select', () => { function resolveRecords( registry, menus ) { const dispatch = registry.dispatch( coreStore ); - dispatch.startResolution( - 'getEntityRecords', - SELECT_NAVIGATION_MENUS_ARGS - ); - dispatch.finishResolution( - 'getEntityRecords', - SELECT_NAVIGATION_MENUS_ARGS - ); + dispatch.startResolution( 'getEntityRecords', [ + 'postType', + 'wp_navigation', + { + per_page: 100, + status: [ 'publish', 'draft' ], + order: 'desc', + orderby: 'date', + }, + ] ); + dispatch.finishResolution( 'getEntityRecords', [ + 'postType', + 'wp_navigation', + { + per_page: 100, + status: [ 'publish', 'draft' ], + order: 'desc', + orderby: 'date', + }, + ] ); dispatch.receiveEntityRecords( 'postType', 'wp_navigation', menus, { per_page: 100, status: [ 'publish', 'draft' ],