Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/block-library/src/paragraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ import save from './save';
import transforms from './transforms';
import { unlock } from '../lock-unlock';

const { fieldsKey, formKey, editableRootKey } = unlock( blocksPrivateApis );
const { fieldsKey, formKey } = unlock( blocksPrivateApis );

const { name } = metadata;

export { metadata, name };

export const settings = {
icon,
// Opt into the editing host behaviour privately. It's a Symbol setting
// rather than a public `supports` key so it stays an internal detail.
[ editableRootKey ]: true,
example: {
attributes: {
content: __(
Expand Down
63 changes: 0 additions & 63 deletions test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,69 +736,6 @@ test.describe( 'Autocomplete (@firefox, @webkit)', () => {
await expect( page.getByRole( 'listbox' ) ).toBeHidden();
} );

test( 'should mirror the suggestions list reference onto the editing host', async ( {
editor,
page,
} ) => {
// The editing host, which `RichText` mirrors these attributes onto by
// hand, only takes over once the block has a sibling.
await editor.canvas
.getByRole( 'button', { name: 'Add default block' } )
.click();
await page.keyboard.type( 'A first paragraph.' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( 'hello @fr' );

await expect(
page.getByRole( 'option', {
name: 'Frodo Baggins',
selected: true,
} )
).toBeVisible();

const editingHost = editor.canvas.getByRole( 'textbox', {
name: 'Editor canvas',
} );

// The popover renders outside the canvas, so the list is mirrored back
// into it — these IDs have to resolve in the host's own document.
const listBoxId = await editor.canvas
.getByRole( 'listbox' )
.getAttribute( 'id' );
const optionId = await editor.canvas
.getByRole( 'option', { name: 'Frodo Baggins' } )
.getAttribute( 'id' );

await expect( editingHost ).toHaveAttribute(
'aria-autocomplete',
'list'
);
await expect( editingHost ).toHaveAttribute(
'aria-haspopup',
'listbox'
);
await expect( editingHost ).toHaveAttribute(
'aria-controls',
listBoxId
);
await expect( editingHost ).toHaveAttribute( 'aria-owns', listBoxId );
await expect( editingHost ).toHaveAttribute(
'aria-activedescendant',
optionId
);

await page.keyboard.press( 'Escape' );
await expect( page.getByRole( 'listbox' ) ).toBeHidden();

// Only an omitted value clears an attribute here: a `null` would land
// on the host as the string "null".
await expect( editingHost ).not.toHaveAttribute( 'aria-controls' );
await expect( editingHost ).not.toHaveAttribute( 'aria-owns' );
await expect( editingHost ).not.toHaveAttribute(
'aria-activedescendant'
);
} );

test( 'should re-trigger autocomplete when backspacing into a completed mention', async ( {
editor,
page,
Expand Down
12 changes: 9 additions & 3 deletions test/e2e/specs/editor/various/core-settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ test.describe( 'Settings', () => {
);

await admin.visitAdminPage( 'options-general.php' );
await page
.getByRole( 'textbox', { name: 'Tagline' } )
.fill( 'Just another Gutenberg site' );
const taglineField = page.getByRole( 'textbox', { name: 'Tagline' } );
const originalTagline = await taglineField.inputValue();
await taglineField.fill( 'Just another Gutenberg site' );
await page.getByRole( 'button', { name: 'Save Changes' } ).click();

const optionsAfter = await getOptionsValues(
Expand All @@ -48,5 +48,11 @@ test.describe( 'Settings', () => {
const optionAfter = [ id, optionsAfter[ id ] ];
expect( optionAfter ).toStrictEqual( optionBefore );
} );

// Restore the tagline: other tests render it through the site
// tagline block, and the changed value would leak into them.
await admin.visitAdminPage( 'options-general.php' );
await taglineField.fill( originalTagline );
await page.getByRole( 'button', { name: 'Save Changes' } ).click();
} );
} );
Loading
Loading