Skip to content

Commit 844a9aa

Browse files
committed
add test and screenshots
1 parent ad5f4cf commit 844a9aa

7 files changed

+29
-0
lines changed

core/src/components/item/test/a11y/item.e2e.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@ import AxeBuilder from '@axe-core/playwright';
22
import { expect } from '@playwright/test';
33
import { configs, test } from '@utils/test/playwright';
44

5+
configs({ directions: ['ltr'], palettes: ['dark'] }).forEach(({ config, screenshot, title }) => {
6+
test.describe(title('item: dark palette'), () => {
7+
/**
8+
* This test was originally created to ensure the item border has sufficient
9+
* contrast. We don't use an Axe test here because Axe not warn about color
10+
* contrast on the item borders.
11+
*/
12+
test('borders should have sufficient contrast', async ({ page }) => {
13+
test.info().annotations.push({
14+
type: 'issue',
15+
description: 'https://github.com/ionic-team/ionic-framework/issues/29386',
16+
});
17+
await page.setContent(
18+
`
19+
<ion-list>
20+
<ion-item>Item</ion-item>
21+
<ion-item>Item</ion-item>
22+
</ion-list>
23+
`,
24+
config
25+
);
26+
27+
const list = page.locator('ion-list');
28+
29+
await expect(list).toHaveScreenshot(screenshot(`item-dark`));
30+
});
31+
});
32+
});
33+
534
configs({ directions: ['ltr'] }).forEach(({ config, screenshot, title }) => {
635
test.describe(title('item: axe'), () => {
736
test('should not have accessibility violations', async ({ page }) => {

0 commit comments

Comments
 (0)