Skip to content

Commit

Permalink
Try steps
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Sep 6, 2022
1 parent 8475658 commit 4895b8a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/e2e/specs/editor/various/draggable-blocks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ test.describe( 'Draggable block', () => {
const firstParagraph = page.locator(
'role=document[name="Paragraph block"i] >> text=1'
);
await firstParagraph.hover( {
position: { x: 0, y: 0 },
// The block will be blocked by toolbar popover, but it will soon disappear
// after we start dragging.
force: true,
const firstParagraphBound = await firstParagraph.boundingBox();
await page.mouse.move( firstParagraphBound.x, firstParagraphBound.y, {
steps: 10,
} );

await expect(
Expand All @@ -68,7 +66,6 @@ test.describe( 'Draggable block', () => {
);
await expect( indicator ).toBeVisible();
// Expect the indicator to be above the first paragraph.
const firstParagraphBound = await firstParagraph.boundingBox();
await expect
.poll( () => indicator.boundingBox().then( ( { y } ) => y ) )
.toBeLessThan( firstParagraphBound.y );
Expand Down Expand Up @@ -123,7 +120,8 @@ test.describe( 'Draggable block', () => {
const secondParagraphBound = await secondParagraph.boundingBox();
await page.mouse.move(
secondParagraphBound.x,
secondParagraphBound.y + secondParagraphBound.height * 0.75
secondParagraphBound.y + secondParagraphBound.height * 0.75,
{ steps: 10 }
);

await expect(
Expand Down

0 comments on commit 4895b8a

Please sign in to comment.