-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add snapshot tests for vertical resizing of elements
- Loading branch information
1 parent
fbfca0b
commit 6f0aaec
Showing
6 changed files
with
130 additions
and
23 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
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
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,15 @@ | ||
import { Locator, expect } from '@playwright/test'; | ||
|
||
export default async function waitForBoundingBox( | ||
locator: Locator, | ||
): Promise<Pick<DOMRect, 'x' | 'y' | 'width' | 'height'>> { | ||
let boundingBox; | ||
await expect(async () => { | ||
boundingBox = await locator.boundingBox(); | ||
expect(boundingBox).toBeTruthy(); | ||
expect(boundingBox!.width).toBeGreaterThan(0); | ||
expect(boundingBox!.height).toBeGreaterThan(0); | ||
}).toPass(); | ||
|
||
return boundingBox!; | ||
} |
43 changes: 43 additions & 0 deletions
43
test/visual/components/fixture/toolpad/pages/grids/page.yml
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,43 @@ | ||
apiVersion: v1 | ||
kind: page | ||
spec: | ||
id: Dh9u36B | ||
title: grids | ||
display: shell | ||
content: | ||
- component: PageRow | ||
name: pageRow | ||
props: | ||
justifyContent: start | ||
children: | ||
- component: PageColumn | ||
name: pageColumn | ||
layout: | ||
columnSize: 1 | ||
children: | ||
- component: DataGrid | ||
name: dataGrid | ||
layout: | ||
columnSize: 1 | ||
props: | ||
rows: | ||
- id: one | ||
columns: | ||
- field: id | ||
type: string | ||
- component: DataGrid | ||
name: dataGrid2 | ||
props: | ||
rows: | ||
- id: two | ||
columns: | ||
- field: id | ||
type: string | ||
- component: DataGrid | ||
name: dataGrid1 | ||
props: | ||
rows: | ||
- id: three | ||
columns: | ||
- field: id | ||
type: string |
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
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