fix: await bounding vox

This commit is contained in:
Michael Brevard 2024-06-15 01:26:02 +03:00 committed by GitHub
parent d5bd5f8392
commit 5390cae241
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2677,7 +2677,7 @@ describe('lazy import components', () => {
expect(await page.locator('body').getByText('This should be visible at first with viewport!').all()).toHaveLength(1) expect(await page.locator('body').getByText('This should be visible at first with viewport!').all()).toHaveLength(1)
expect(await page.locator('body').getByText('This should be visible at first with events!').all()).toHaveLength(1) expect(await page.locator('body').getByText('This should be visible at first with events!').all()).toHaveLength(1)
const component = await page.locator('#lazyevent'); const component = await page.locator('#lazyevent');
const rect = component.boundingBox() const rect = await component.boundingBox()
await page.mouse.move(rect.x + rect.width / 2, rect.y + rect.height / 2) await page.mouse.move(rect.x + rect.width / 2, rect.y + rect.height / 2)
await page.waitForLoadState('networkidle') await page.waitForLoadState('networkidle')
expect(await page.locator('body').getByText('This shouldn\'t be visible at first with events!').all()).toHaveLength(1) expect(await page.locator('body').getByText('This shouldn\'t be visible at first with events!').all()).toHaveLength(1)