test(accordion): remove unnecessary tests (#26009)

This commit is contained in:
Liam DeBeasi
2022-09-27 12:25:37 -05:00
committed by GitHub
parent 419b1cb461
commit ffadf5ea0b
57 changed files with 31 additions and 7 deletions

View File

@ -2,7 +2,9 @@ import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';
test.describe('accordion: multiple', () => {
test('should update value and not have visual regressions', async ({ page }) => {
test('should update value and visually expand items', async ({ page, skip }) => {
skip.rtl();
await page.goto(`/src/components/accordion/test/multiple`);
const accordionGroup = page.locator('ion-accordion-group');
const diningHeader = page.locator('ion-accordion[value="dining"] ion-item[slot="header"]');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -2,11 +2,33 @@ import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';
test.describe('accordion: nested', () => {
test('should not have visual regressions', async ({ page }) => {
test.beforeEach(async ({ page, skip }) => {
skip.rtl();
await page.goto(`/src/components/accordion/test/nested`);
});
await page.setIonViewport();
test('parent and child should not be disabled', async ({ page }) => {
const enabledGroup = page.locator('ion-accordion-group#enabled');
expect(await page.screenshot()).toMatchSnapshot(`accordion-nested-${page.getSnapshotSettings()}.png`);
expect(await enabledGroup.screenshot()).toMatchSnapshot(
`accordion-nested-enabled-${page.getSnapshotSettings()}.png`
);
});
test('parent should not be disabled when only child is disabled', async ({ page }) => {
const nestedDisabledGroup = page.locator('ion-accordion-group#nested-disabled');
expect(await nestedDisabledGroup.screenshot()).toMatchSnapshot(
`accordion-child-disabled-${page.getSnapshotSettings()}.png`
);
});
test('parent and child should be disabled when parent is disabled', async ({ page }) => {
const parentDisabledGroup = page.locator('ion-accordion-group#parent-disabled');
expect(await parentDisabledGroup.screenshot()).toMatchSnapshot(
`accordion-parent-disabled-${page.getSnapshotSettings()}.png`
);
});
});

View File

@ -43,7 +43,7 @@
<div class="grid ion-padding">
<div class="grid-item">
<h2>Nested</h2>
<ion-accordion-group expand="inset" value="attractions">
<ion-accordion-group id="enabled" expand="inset" value="attractions">
<ion-accordion value="attractions">
<ion-item color="primary" slot="header" button detail="false">
<ion-icon slot="start" ios="film-outline" md="film"></ion-icon>
@ -75,7 +75,7 @@
</div>
<div class="grid-item">
<h2>Nested Disabled</h2>
<ion-accordion-group expand="inset" value="attractions">
<ion-accordion-group id="nested-disabled" expand="inset" value="attractions">
<ion-accordion value="attractions">
<ion-item color="primary" slot="header" button detail="false">
<ion-icon slot="start" ios="film-outline" md="film"></ion-icon>
@ -107,7 +107,7 @@
</div>
<div class="grid-item">
<h2>Nested Parent Disabled</h2>
<ion-accordion-group expand="inset" value="attractions" disabled="true">
<ion-accordion-group id="parent-disabled" expand="inset" value="attractions" disabled="true">
<ion-accordion value="attractions">
<ion-item color="primary" slot="header" button detail="false">
<ion-icon slot="start" ios="film-outline" md="film"></ion-icon>