Skip to content

Commit

Permalink
Use simpler handle getter
Browse files Browse the repository at this point in the history
waitForSelector implies element is visible
  • Loading branch information
WunderBart committed Aug 24, 2022
1 parent 6abc644 commit e67b953
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/storybook-playwright/specs/font-size-picker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import { test, expect } from '@wordpress/e2e-test-utils-playwright';
import { gotoStoryId } from '../utils';

const waitUntilButtonHighlightStable = async ( page ) => {
const handle = await page
.locator( '[aria-label="Font size"] > div[role=presentation]' )
.elementHandle();
const handle = await page.waitForSelector(
'[aria-label="Font size"] > div[role=presentation]'
);

await handle?.waitForElementState( 'visible' );
await handle?.waitForElementState( 'stable' );

return handle;
Expand Down

0 comments on commit e67b953

Please sign in to comment.