Skip to content

Commit

Permalink
useBlockSync: fix typo and simplify test (#55203)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr authored Oct 10, 2023
1 parent f0b4192 commit d564bc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TestWrapper = withRegistryProvider( ( props ) => {
props.setRegistry( props.registry );
}
useBlockSync( props );
return <p>Test.</p>;
return null;
} );

describe( 'useBlockSync hook', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default function useBlockSync( {
// bound sync, unset the outbound value to avoid considering it in
// subsequent renders.
pendingChanges.current.outgoing = [];
const hadSelecton = hasSelectedBlock();
const hadSelection = hasSelectedBlock();
const selectionAnchor = getSelectionStart();
const selectionFocus = getSelectionEnd();
setControlledBlocks();
Expand All @@ -195,7 +195,7 @@ export default function useBlockSync( {
const selectionStillExists = getBlock(
selectionAnchor.clientId
);
if ( hadSelecton && ! selectionStillExists ) {
if ( hadSelection && ! selectionStillExists ) {
selectBlock( clientId );
} else {
resetSelection( selectionAnchor, selectionFocus );
Expand Down

1 comment on commit d564bc9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in d564bc9.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6469365777
📝 Reported issues:

Please sign in to comment.