-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Internal: add
render-height
Masonry integration test
- Loading branch information
1 parent
abfc2b9
commit 06da91a
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// @flow strict | ||
import { expect, test } from '@playwright/test'; | ||
import getGridItems from './utils/getGridItems.mjs'; | ||
import getServerURL from './utils/getServerURL.mjs'; | ||
import selectors from './utils/selectors.mjs'; | ||
|
||
test.describe('Masonry: Render height', () => { | ||
test('allows items to be positioned under the grid', async ({ page }) => { | ||
await page.goto(getServerURL({ virtualize: true, finiteLength: true })); | ||
|
||
const gridItems = await getGridItems(page); | ||
expect(gridItems.length).toBeGreaterThan(0); | ||
|
||
let bottomItem = 0; | ||
for (let i = 0; i < gridItems.length; i += 1) { | ||
const itemRect = await gridItems[i].boundingBox(); | ||
// eslint-disable-next-line playwright/no-conditional-in-test | ||
if (itemRect.y > bottomItem) { | ||
bottomItem = itemRect.y + itemRect.height; | ||
} | ||
} | ||
|
||
const afterGrid = await page.locator(selectors.afterGrid); | ||
const afterGridRect = await afterGrid.boundingBox(); | ||
expect(afterGridRect.y).toBeGreaterThanOrEqual(bottomItem); | ||
}); | ||
}); |