Skip to content

Commit

Permalink
Use resetBlocks instead of insertBlocks in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Oct 9, 2024
1 parent 23ac64b commit e52bab2
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ describe( 'useBlockBindingsUtils', () => {
},
},
} );
await dispatch( blockEditorStore ).insertBlocks( block );
await dispatch( blockEditorStore ).resetBlocks( [ block ] );
clientId = block.clientId;
} );

// Clean up after each test by removing all blocks
afterEach( () => {
afterAll( () => {
// Remove blocks after all tests.
dispatch( blockEditorStore ).resetBlocks( [] );
} );

afterAll( () => {
// Clean up registered blocks
getBlockTypes().forEach( ( block ) => {
unregisterBlockType( block.name );
Expand Down

0 comments on commit e52bab2

Please sign in to comment.