Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Oct 22, 2020
1 parent c41cd62 commit 12ab49e
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ describe( 'useBlockSync hook', () => {
expect( onInput ).not.toHaveBeenCalled();
expect( replaceInnerBlocks ).toHaveBeenCalledWith(
'test', // It should use the given client ID.
fakeBlocks, // It should use the controlled blocks value.
false // It shoudl not update the selection state.
fakeBlocks // It should use the controlled blocks value.
);

const testBlocks = [
Expand All @@ -119,11 +118,7 @@ describe( 'useBlockSync hook', () => {
expect( onChange ).not.toHaveBeenCalled();
expect( onInput ).not.toHaveBeenCalled();
expect( resetBlocks ).not.toHaveBeenCalled();
expect( replaceInnerBlocks ).toHaveBeenCalledWith(
'test',
testBlocks,
false
);
expect( replaceInnerBlocks ).toHaveBeenCalledWith( 'test', testBlocks );
} );

it( 'does not add the controlled blocks to the block-editor store if the store already contains them', async () => {
Expand Down Expand Up @@ -315,7 +310,7 @@ describe( 'useBlockSync hook', () => {
);
} );

expect( replaceInnerBlocks ).toHaveBeenCalledWith( 'test', [], false );
expect( replaceInnerBlocks ).toHaveBeenCalledWith( 'test', [] );
expect( onChange ).not.toHaveBeenCalled();
expect( onInput ).not.toHaveBeenCalled();
} );
Expand Down

0 comments on commit 12ab49e

Please sign in to comment.