Skip to content

Commit

Permalink
Wait with selector instead of requestIdleCallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
torounit committed Jun 22, 2022
1 parent 6b8a4fa commit 6a3eb63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/e2e/specs/editor/blocks/list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ test.describe( 'List', () => {
} ) => {
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type( '* ' );
await page.evaluate( () => new Promise( window.requestIdleCallback ) );
await expect( page.locator( '[data-type="core/list"]' ) ).toBeVisible();
await page.keyboard.press( 'Backspace' );

await expect.poll( editor.getEditedPostContent ).toBe(
Expand Down Expand Up @@ -128,7 +128,7 @@ test.describe( 'List', () => {
await page.click( 'role=button[name="Add default block"i]' );
await page.evaluate( () => delete window.requestIdleCallback );
await page.keyboard.type( '* ' );
await new Promise( ( resolve ) => setTimeout( resolve, 100 ) );
await expect( page.locator( '[data-type="core/list"]' ) ).toBeVisible();
await page.keyboard.press( 'Backspace' );

await expect.poll( editor.getEditedPostContent ).toBe(
Expand Down Expand Up @@ -172,7 +172,7 @@ test.describe( 'List', () => {
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( '* ' );
await page.evaluate( () => new Promise( window.requestIdleCallback ) );
await expect( page.locator( '[data-type="core/list"]' ) ).toBeVisible();
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.press( 'ArrowDown' );
await page.keyboard.press( 'Backspace' );
Expand Down

0 comments on commit 6a3eb63

Please sign in to comment.