|
1 | 1 | import { expect } from '@playwright/test';
|
2 | 2 | import { configs, test, dragElementBy } from '@utils/test/playwright';
|
3 | 3 |
|
4 |
| -configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { |
5 |
| - test.describe(title('sheet modal: rendering'), () => { |
6 |
| - test('should not have visual regressions', async ({ page }) => { |
7 |
| - await page.goto('/src/components/modal/test/sheet', config); |
8 |
| - const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); |
| 4 | +configs({ modes: ['ios', 'md', 'ionic-ios', 'ionic-md'], directions: ['ltr'] }).forEach( |
| 5 | + ({ title, screenshot, config }) => { |
| 6 | + test.describe(title('sheet modal: rendering'), () => { |
| 7 | + test('should not have visual regressions', async ({ page }) => { |
| 8 | + await page.goto('/src/components/modal/test/sheet', config); |
| 9 | + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); |
9 | 10 |
|
10 |
| - await page.click('#sheet-modal'); |
| 11 | + await page.click('#sheet-modal'); |
11 | 12 |
|
12 |
| - await ionModalDidPresent.next(); |
| 13 | + await ionModalDidPresent.next(); |
13 | 14 |
|
14 |
| - await expect(page).toHaveScreenshot(screenshot(`modal-sheet-present`), { |
15 |
| - /** |
16 |
| - * Animations must be enabled to capture the screenshot. |
17 |
| - * By default, animations are disabled with toHaveScreenshot, |
18 |
| - * and when capturing the screenshot will call animation.finish(). |
19 |
| - * This will cause the modal to close and the screenshot capture |
20 |
| - * to be invalid. |
21 |
| - */ |
22 |
| - animations: 'allow', |
| 15 | + await expect(page).toHaveScreenshot(screenshot(`modal-sheet-present`), { |
| 16 | + /** |
| 17 | + * Animations must be enabled to capture the screenshot. |
| 18 | + * By default, animations are disabled with toHaveScreenshot, |
| 19 | + * and when capturing the screenshot will call animation.finish(). |
| 20 | + * This will cause the modal to close and the screenshot capture |
| 21 | + * to be invalid. |
| 22 | + */ |
| 23 | + animations: 'allow', |
| 24 | + }); |
23 | 25 | });
|
24 | 26 | });
|
25 |
| - }); |
26 |
| -}); |
| 27 | + } |
| 28 | +); |
27 | 29 |
|
28 | 30 | configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
29 | 31 | test.describe(title('sheet modal: half screen rendering'), () => {
|
@@ -62,7 +64,7 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh
|
62 | 64 | });
|
63 | 65 | });
|
64 | 66 |
|
65 |
| -configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { |
| 67 | +configs({ modes: ['ios', 'ionic-ios'], directions: ['ltr'] }).forEach(({ title, config }) => { |
66 | 68 | test.describe(title('sheet modal: backdrop'), () => {
|
67 | 69 | test.beforeEach(async ({ page }) => {
|
68 | 70 | await page.goto('/src/components/modal/test/sheet', config);
|
@@ -175,7 +177,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
|
175 | 177 | const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange');
|
176 | 178 | const header = page.locator('.modal-sheet ion-header');
|
177 | 179 |
|
178 |
| - await dragElementBy(header, page, 0, 125); |
| 180 | + await dragElementBy(header, page, 0, 110); |
179 | 181 |
|
180 | 182 | await ionBreakpointDidChange.next();
|
181 | 183 |
|
|
0 commit comments