Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix test case
  • Loading branch information
fabiankaegy committed Apr 17, 2024
commit b57a6821a3b5dbb65fe415500aaf29630357a180
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,44 @@ describe( 'DisableNonPageContentBlocks', () => {
type: 'UNSET_BLOCK_EDITING_MODE',
} ) );

const registry = createRegistry( {
'core/block-editor': {
reducer: () => {},
selectors: {
getBlocksByName( state, blockNames ) {
return Object.keys( testBlocks ).filter( ( clientId ) =>
blockNames.includes( testBlocks[ clientId ] )
);
},
getBlockParents( state, clientId ) {
return clientId.slice( 0, -1 ).split( '' );
},
getBlockName( state, clientId ) {
return testBlocks[ clientId ];
},
getBlockOrder( state, rootClientId ) {
return Object.keys( testBlocks ).filter(
( clientId ) =>
clientId.startsWith( rootClientId ) &&
clientId !== rootClientId
);
},
const registry = createRegistry();

registry.registerStore( 'core/block-editor', {
reducer: () => {},
selectors: {
getBlocksByName( state, blockNames ) {
return Object.keys( testBlocks ).filter( ( clientId ) =>
blockNames.includes( testBlocks[ clientId ] )
);
},
getBlockParents( state, clientId ) {
return clientId.slice( 0, -1 ).split( '' );
},
getBlockName( state, clientId ) {
return testBlocks[ clientId ];
},
getBlockOrder( state, rootClientId ) {
return Object.keys( testBlocks ).filter(
( clientId ) =>
clientId.startsWith( rootClientId ) &&
clientId !== rootClientId
);
},
actions: {
setBlockEditingMode,
unsetBlockEditingMode,
},
actions: {
setBlockEditingMode,
unsetBlockEditingMode,
},
} );

registry.registerStore( 'core', {
reducer: () => {},
selectors: {
canUser() {
return true;
},
},
actions: {},
} );

const { unmount } = render(
Expand Down