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. -->
This commit is contained in:
Liam DeBeasi
2023-05-03 20:05:05 -04:00
committed by GitHub
parent 99f6412b85
commit af55e09037
14 changed files with 31 additions and 26 deletions

View File

@@ -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();
});
});

View 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();
});
});
});