Skip to content

Commit

Permalink
Rename URL to Link and avoid triggering command centre
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Jun 26, 2023
1 parent ffb0435 commit a78ba7e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions test/e2e/specs/editor/blocks/buttons.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ test.describe( 'Buttons', () => {

test( 'has focus on button content', async ( { editor, page } ) => {
await editor.insertBlock( { name: 'core/buttons' } );
await expect(
editor.canvas.locator( 'role=textbox[name="Button text"i]' )
).toBeFocused();
await page.keyboard.type( 'Content' );

// Check the content.
Expand Down Expand Up @@ -50,9 +53,12 @@ test.describe( 'Buttons', () => {
} ) => {
// Regression: https://github.com/WordPress/gutenberg/pull/19885
await editor.insertBlock( { name: 'core/buttons' } );
await expect(
editor.canvas.locator( 'role=textbox[name="Button text"i]' )
).toBeFocused();
await pageUtils.pressKeys( 'primary+k' );
await expect(
page.locator( 'role=combobox[name="URL"i]' )
page.locator( 'role=combobox[name="Link"i]' )
).toBeFocused();
await page.keyboard.press( 'Escape' );
await expect(
Expand All @@ -78,9 +84,12 @@ test.describe( 'Buttons', () => {
} ) => {
// Regression: https://github.com/WordPress/gutenberg/issues/34307
await editor.insertBlock( { name: 'core/buttons' } );
await expect(
editor.canvas.locator( 'role=textbox[name="Button text"i]' )
).toBeFocused();
await pageUtils.pressKeys( 'primary+k' );
await expect(
page.locator( 'role=combobox[name="URL"i]' )
page.locator( 'role=combobox[name="Link"i]' )
).toBeFocused();
await page.keyboard.type( 'https://example.com' );
await page.keyboard.press( 'Enter' );
Expand All @@ -107,9 +116,12 @@ test.describe( 'Buttons', () => {
} ) => {
// Regression: https://github.com/WordPress/gutenberg/issues/34307
await editor.insertBlock( { name: 'core/buttons' } );
await expect(
editor.canvas.locator( 'role=textbox[name="Button text"i]' )
).toBeFocused();
await pageUtils.pressKeys( 'primary+k' );

const urlInput = page.locator( 'role=combobox[name="URL"i]' );
const urlInput = page.locator( 'role=combobox[name="Link"i]' );

await expect( urlInput ).toBeFocused();
await page.keyboard.type( 'example.com' );
Expand Down

0 comments on commit a78ba7e

Please sign in to comment.