Skip to content

Commit 0ac796d

Browse files
committed
Fix unit tests
1 parent a09263f commit 0ac796d

File tree

7 files changed

+22
-30
lines changed

7 files changed

+22
-30
lines changed

packages/block-editor/src/components/block-list/block.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
isUnmodifiedDefaultBlock,
1919
serializeRawBlock,
2020
switchToBlockType,
21+
__experimentalAccessKey as blocksAccessKey,
2122
} from '@wordpress/blocks';
2223
import { withFilters } from '@wordpress/components';
2324
import {
@@ -45,10 +46,10 @@ import {
4546
} from '../../experiments';
4647

4748
const {
48-
__experimentalHasContentRoleAttribute,
4949
__unstableGetContentLockingParent,
5050
__unstableGetTemporarilyEditingAsBlocks,
5151
} = unlock( blockEditorExperiments );
52+
const { __experimentalHasContentRoleAttribute } = unlock( blocksAccessKey );
5253

5354
export const BlockListBlockContext = createContext();
5455

packages/block-editor/src/experiments.js

+12-13
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,18 @@ const { __experimentalPrivateSelector } = unlock( dataExperiments );
2424

2525
export const __experimentalAccessKey = register( {
2626
// Follow-up on https://github.com/WordPress/gutenberg/pull/42934
27-
__unstableSelectionHasUnmergeableBlock: () =>
28-
__experimentalPrivateSelector(
29-
store,
30-
__unstableSelectionHasUnmergeableBlock
31-
),
27+
__unstableSelectionHasUnmergeableBlock: __experimentalPrivateSelector(
28+
store,
29+
__unstableSelectionHasUnmergeableBlock
30+
),
3231

3332
// Follow-up on https://github.com/WordPress/gutenberg/pull/43037
34-
__unstableGetContentLockingParent: ( ...args ) =>
35-
__experimentalPrivateSelector( store, () =>
36-
__unstableGetContentLockingParent( ...args )
37-
),
38-
__unstableGetTemporarilyEditingAsBlocks: ( ...args ) =>
39-
__experimentalPrivateSelector( store, () =>
40-
__unstableGetTemporarilyEditingAsBlocks( ...args )
41-
),
33+
__unstableGetContentLockingParent: __experimentalPrivateSelector(
34+
store,
35+
__unstableGetContentLockingParent
36+
),
37+
__unstableGetTemporarilyEditingAsBlocks: __experimentalPrivateSelector(
38+
store,
39+
__unstableGetTemporarilyEditingAsBlocks
40+
),
4241
} );

packages/block-library/src/experiments.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/exp
66
export const { register, unlock } =
77
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
88
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
9-
'@wordpress/block-editor'
9+
'@wordpress/block-library'
1010
);

packages/block-library/src/media-text/experiments.js

-10
This file was deleted.

packages/blocks/src/experiments.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const { __experimentalPrivateSelector } = unlock( dataExperiments );
2020

2121
export const __experimentalAccessKey = register( {
2222
// Follow-up on https://github.com/WordPress/gutenberg/pull/42934
23-
__experimentalHasContentRoleAttribute: ( ...args ) =>
24-
__experimentalPrivateSelector( store, () =>
25-
__experimentalHasContentRoleAttribute( ...args )
26-
),
23+
__experimentalHasContentRoleAttribute: __experimentalPrivateSelector(
24+
store,
25+
__experimentalHasContentRoleAttribute
26+
),
2727
} );

packages/blocks/src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
export { store } from './store';
1212
export * from './api';
1313
export * from './deprecated';
14+
export { __experimentalAccessKey } from './experiments';

packages/data/src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ const experimentalAPIs = __dangerousOptInToUnstableAPIsOnlyForCoreModules(
241241
);
242242

243243
function __experimentalPrivateSelector( { name }, selector ) {
244-
return defaultRegistry.stores[ name ].store.select( selector );
244+
return ( ...args ) =>
245+
selector( defaultRegistry.stores[ name ].store.getState(), ...args );
245246
}
246247
function __experimentalPrivateDispatch( { name }, actionThunk ) {
247248
return defaultRegistry.stores[ name ].store.dispatch( actionThunk );

0 commit comments

Comments
 (0)