test(split-pane): migrate to generators (#27378)
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Split-pane tests are using legacy syntax ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Split-pane tests are using modern syntax ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
@@ -1,26 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test, Viewports } from '@utils/test/playwright';
|
||||
|
||||
test.describe('split-pane: basic', () => {
|
||||
test('should render on the correct side', async ({ page }) => {
|
||||
await page.setViewportSize(Viewports.large);
|
||||
await page.goto(`/src/components/split-pane/test/basic`);
|
||||
|
||||
await expect(page).toHaveScreenshot(`split-pane-${page.getSnapshotSettings()}.png`, { animations: 'disabled' });
|
||||
});
|
||||
test('should collapse on smaller viewports', async ({ page, skip }) => {
|
||||
skip.rtl();
|
||||
await page.goto(`/src/components/split-pane/test/basic`);
|
||||
|
||||
const menu = page.locator('ion-menu');
|
||||
await expect(menu).toBeHidden();
|
||||
});
|
||||
test('should expand on larger viewports', async ({ page, skip }) => {
|
||||
skip.rtl();
|
||||
await page.setViewportSize(Viewports.large);
|
||||
await page.goto(`/src/components/split-pane/test/basic`);
|
||||
|
||||
const menu = page.locator('ion-menu');
|
||||
await expect(menu).toBeVisible();
|
||||
});
|
||||
});
|
||||
31
core/src/components/split-pane/test/basic/split-pane.e2e.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test, Viewports } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('split-pane: basic'), () => {
|
||||
test('should render on the correct side', async ({ page }) => {
|
||||
await page.setViewportSize(Viewports.large);
|
||||
await page.goto(`/src/components/split-pane/test/basic`, config);
|
||||
|
||||
await expect(page).toHaveScreenshot(screenshot(`split-pane`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
configs({ directions: ['ltr'] }).forEach(({ title, config }) => {
|
||||
test.describe(title('split-pane: functionality'), () => {
|
||||
test('should collapse on smaller viewports', async ({ page }) => {
|
||||
await page.goto(`/src/components/split-pane/test/basic`, config);
|
||||
|
||||
const menu = page.locator('ion-menu');
|
||||
await expect(menu).toBeHidden();
|
||||
});
|
||||
test('should expand on larger viewports', async ({ page }) => {
|
||||
await page.setViewportSize(Viewports.large);
|
||||
await page.goto(`/src/components/split-pane/test/basic`, config);
|
||||
|
||||
const menu = page.locator('ion-menu');
|
||||
await expect(menu).toBeVisible();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |