Skip to content

Commit

Permalink
Update tests for closing link overlay to go straight to appender
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj committed Dec 19, 2024
1 parent f53e571 commit 18cfff0
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions test/e2e/specs/editor/blocks/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,20 +342,10 @@ test.describe( 'Navigation block', () => {
await pageUtils.pressKeys( 'ArrowDown' );
await navigation.useBlockInserter();
await navigation.addLinkClose();
/**
* TODO: This is not desired behavior. Ideally the
* Appender should be focused again since it opened
* the link control.
* IMPORTANT: This check is not to enforce this behavior,
* but to make sure focus is kept nearby until we are able
* to send focus to the appender.
*/
await expect( navBlock ).toBeFocused();
await expect( navigation.getNavBlockInserter() ).toBeFocused();
} );

await test.step( 'should send focus to the newly created navigation link item when creating a link', async () => {
await pageUtils.pressKeys( 'ArrowDown' );

await navigation.useBlockInserter();
await navigation.addPage( 'Cat' );
} );
Expand Down Expand Up @@ -429,20 +419,10 @@ test.describe( 'Navigation block', () => {
await pageUtils.pressKeys( 'ArrowRight', { times: 2 } );
await navigation.useBlockInserter();
await navigation.addLinkClose();
/**
* TODO: This is not desired behavior. Ideally the
* Appender should be focused again since it opened
* the link control.
* IMPORTANT: This check is not to enforce this behavior,
* but to make sure focus is kept nearby until we are able
* to send focus to the appender. It is falling back to the previous sibling.
*/
await navigation.checkLabelFocus( 'Dog' );
await expect( navigation.getNavBlockInserter() ).toBeFocused();
} );

await test.step( 'should be able to add a custom link to a submenu nav item using the nav item appender', async () => {
await page.keyboard.press( 'End' );
await pageUtils.pressKeys( 'ArrowRight', { times: 2 } );
await navigation.useBlockInserter();
await navigation.addCustomURL( 'https://wordpress.org' );
await navigation.expectToHaveTextSelected( 'wordpress.org' );
Expand Down

0 comments on commit 18cfff0

Please sign in to comment.