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

FontSizePicker: use CustomSelectControl V2 legacy adapter #63134

Merged
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
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- Extract `TimeInput` component from `TimePicker` ([#60613](https://github.com/WordPress/gutenberg/pull/60613)).
- `TimeInput`: Add `label` prop ([#63106](https://github.com/WordPress/gutenberg/pull/63106)).
- Method style type signatures have been changed to function style ([#62718](https://github.com/WordPress/gutenberg/pull/62718)).
- `FontSizePicker`: use CustomSelectControl V2 legacy adapter ([#63134](https://github.com/WordPress/gutenberg/pull/63134)).

## 28.2.0 (2024-06-26)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { __, sprintf } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import CustomSelectControl from '../custom-select-control';
import CustomSelectControl from '../custom-select-control-v2/legacy-component';
import { parseQuantityAndUnitFromRawValue } from '../unit-control';
import type {
FontSizePickerSelectProps,
Expand Down
12 changes: 6 additions & 6 deletions packages/components/src/font-size-picker/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe( 'FontSizePicker', () => {
const user = userEvent.setup();
render( <FontSizePicker fontSizes={ fontSizes } /> );
await user.click(
screen.getByRole( 'button', { name: 'Font size' } )
screen.getByRole( 'combobox', { name: 'Font size' } )
);
const options = screen.getAllByRole( 'option' );
expect( options ).toHaveLength( 8 );
Expand Down Expand Up @@ -148,7 +148,7 @@ describe( 'FontSizePicker', () => {
/>
);
await user.click(
screen.getByRole( 'button', { name: 'Font size' } )
screen.getByRole( 'combobox', { name: 'Font size' } )
);
await user.click(
screen.getByRole( 'option', { name: option } )
Expand Down Expand Up @@ -200,7 +200,7 @@ describe( 'FontSizePicker', () => {
const user = userEvent.setup();
render( <FontSizePicker fontSizes={ fontSizes } /> );
await user.click(
screen.getByRole( 'button', { name: 'Font size' } )
screen.getByRole( 'combobox', { name: 'Font size' } )
);
const options = screen.getAllByRole( 'option' );
expect( options ).toHaveLength( 8 );
Expand All @@ -225,7 +225,7 @@ describe( 'FontSizePicker', () => {
<FontSizePicker fontSizes={ fontSizes } value={ value } />
);
expect(
screen.getByRole( 'button', { name: 'Font size' } )
screen.getByRole( 'combobox', { name: 'Font size' } )
).toHaveTextContent( option );
}
);
Expand Down Expand Up @@ -291,7 +291,7 @@ describe( 'FontSizePicker', () => {
/>
);
await user.click(
screen.getByRole( 'button', { name: 'Font size' } )
screen.getByRole( 'combobox', { name: 'Font size' } )
);
await user.click(
screen.getByRole( 'option', { name: option } )
Expand Down Expand Up @@ -509,7 +509,7 @@ describe( 'FontSizePicker', () => {
<FontSizePicker fontSizes={ fontSizes } onChange={ onChange } />
);
await user.click(
screen.getByRole( 'button', { name: 'Font size' } )
screen.getByRole( 'combobox', { name: 'Font size' } )
);
await user.click(
screen.getByRole( 'option', { name: 'Custom' } )
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/specs/editor/various/font-size-picker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ test.describe( 'Font Size Picker', () => {
.click();
await page.keyboard.type( 'Paragraph to be made "large"' );
await page.click(
'role=group[name="Font size"i] >> role=button[name="Font size"i]'
'role=group[name="Font size"i] >> role=combobox[name="Font size"i]'
);
await pageUtils.pressKeys( 'ArrowDown', { times: 4 } );
await page.keyboard.press( 'Enter' );
Expand All @@ -168,7 +168,7 @@ test.describe( 'Font Size Picker', () => {
'Paragraph with font size reset using tools panel menu'
);
await page.click(
'role=group[name="Font size"i] >> role=button[name="Font size"i]'
'role=group[name="Font size"i] >> role=combobox[name="Font size"i]'
);
await pageUtils.pressKeys( 'ArrowDown', { times: 3 } );
await page.keyboard.press( 'Enter' );
Expand Down Expand Up @@ -201,7 +201,7 @@ test.describe( 'Font Size Picker', () => {
'Paragraph with font size reset using input field'
);
await page.click(
'role=group[name="Font size"i] >> role=button[name="Font size"i]'
'role=group[name="Font size"i] >> role=combobox[name="Font size"i]'
);
await pageUtils.pressKeys( 'ArrowDown', { times: 2 } );
await page.keyboard.press( 'Enter' );
Expand Down
Loading