Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed Apr 17, 2024
1 parent 651babf commit 7e095bd
Showing 1 changed file with 35 additions and 25 deletions.
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

0 comments on commit 7e095bd

Please sign in to comment.