Skip to content

Commit

Permalink
Adjust tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Feb 3, 2025
1 parent 5842e3b commit d8fd7b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/font-size-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const UnforwardedFontSizePicker = (
<UnitControl
__next40pxDefaultSize={ __next40pxDefaultSize }
__shouldNotWarnDeprecated36pxSize
label={ __( 'Font size' ) }
label={ __( 'Custom font size' ) }
labelPosition="top"
hideLabelFromVision
value={ value }
Expand Down
12 changes: 3 additions & 9 deletions test/e2e/specs/site-editor/style-variations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ test.describe( 'Global styles variations', () => {
await page.click( 'role=button[name="Text"i]' );

await expect(
page.locator( 'css=.components-font-size-picker__header__hint' )
).toHaveText( 'Medium' );
page.locator( 'role=radio[name="Medium"i]' )
).toHaveAttribute( 'aria-checked', 'true' );
} );

test( 'should apply custom colors and font sizes in a variation', async ( {
Expand Down Expand Up @@ -132,14 +132,8 @@ test.describe( 'Global styles variations', () => {
await page.click( 'role=button[name="Typography"i]' );
await page.click( 'role=button[name="Text"i]' );

// TODO: to avoid use classnames to locate these elements,
// we could provide accessible attributes to the source code in packages/components/src/font-size-picker/index.js.
await expect(
page.locator( 'css=.components-font-size-picker__header__hint' )
).toHaveText( 'Custom' );

await expect(
page.locator( 'role=spinbutton[name="Custom"i]' )
page.locator( 'role=spinbutton[name="Custom font size"i]' )
).toHaveValue( '15' );
} );

Expand Down

0 comments on commit d8fd7b0

Please sign in to comment.