Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the text of the block alignment control to include "width" #42106

Closed
wants to merge 4 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ exports[`BlockAlignmentUI should match snapshot 1`] = `
</SVG>
}
isCollapsed={true}
label="Align"
label="Change alignment or width"
popoverProps={
Object {
"isAlternate": true,
}
}
toggleProps={
Object {
"describedBy": "Change alignment",
"describedBy": "Change alignment or width",
}
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ it( 'should call onChange with undefined when the control is already active', ()
const screen = render(
<BlockAlignmentUI value="right" onChange={ onChangeMock } />
);
const alignButton = screen.getByA11yLabel( 'Align' );
const alignButton = screen.getByA11yLabel( 'Change alignment or width' );
fireEvent.press( alignButton );
const rightAlignmentButton = screen.getByA11yLabel( 'Align right' );
fireEvent.press( rightAlignmentButton );
Expand All @@ -27,7 +27,7 @@ it( 'should call onChange with alignment value when the control is inactive', ()
const screen = render(
<BlockAlignmentUI value="left" onChange={ onChangeMock } />
);
const alignButton = screen.getByA11yLabel( 'Align' );
const alignButton = screen.getByA11yLabel( 'Change alignment or width' );
fireEvent.press( alignButton );
const centerAlignmentButton = screen.getByA11yLabel( 'Align center' );
fireEvent.press( centerAlignmentButton );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ function BlockAlignmentUI( {
icon: activeAlignmentControl
? activeAlignmentControl.icon
: defaultAlignmentControl.icon,
label: __( 'Align' ),
toggleProps: { describedBy: __( 'Change alignment' ) },
label: __( 'Change alignment or width' ),
toggleProps: { describedBy: __( 'Change alignment or width' ) },
};
const extraProps = isToolbar
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function BlockAlignmentUI( {
: toolbarUIComponent;

const commonProps = {
label: __( 'Align' ),
label: __( 'Change alignment or width' ),
};
const extraProps = isBottomSheetControl
? {
Expand Down Expand Up @@ -77,7 +77,7 @@ function BlockAlignmentUI( {
};
} ),
popoverProps: POPOVER_PROPS,
toggleProps: { describedBy: __( 'Change alignment' ) },
toggleProps: { describedBy: __( 'Change alignment or width' ) },
};

return <UIComponent { ...commonProps } { ...extraProps } />;
Expand Down
4 changes: 3 additions & 1 deletion packages/block-library/src/embed/test/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,9 @@ describe( 'Embed block', () => {

// Open alignment options.
fireEvent.press(
await waitFor( () => getByA11yLabel( 'Align' ) )
await waitFor( () =>
getByA11yLabel( 'Change alignment or width' )
)
);

// Select alignment option.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe( 'Align Hook Works As Expected', () => {
it( 'Shows no alignment buttons on the alignment toolbar', async () => {
await insertBlock( BLOCK_NAME );
const CHANGE_ALIGNMENT_BUTTON_SELECTOR =
'.block-editor-block-toolbar .components-dropdown-menu__toggle[aria-label="Align"]';
'.block-editor-block-toolbar .components-dropdown-menu__toggle[aria-label="Change alignment or width"]';
const changeAlignmentButton = await page.$(
CHANGE_ALIGNMENT_BUTTON_SELECTOR
);
Expand Down