Skip to content

Commit b148b32

Browse files
chore(playwright): migrate themes to palettes (#29148)
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. --> ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Migrates the test infrastructure to use `palettes` instead of `themes` ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## 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 **does not** change where the light/dark/high contrast styles live or how they are consumed in the test infra. That work is done here: #29149 Co-authored-by: Liam DeBeasi <[email protected]>
1 parent 7821b78 commit b148b32

File tree

28 files changed

+56
-56
lines changed

28 files changed

+56
-56
lines changed

core/src/components/action-sheet/test/a11y/action-sheet.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const testAriaButton = async (
4040
await expect(actionSheetButton).toHaveAttribute('aria-label', expectedAriaLabel);
4141
};
4242

43-
configs({ directions: ['ltr'], themes: ['dark', 'light'] }).forEach(({ config, title }) => {
43+
configs({ directions: ['ltr'], palettes: ['dark', 'light'] }).forEach(({ config, title }) => {
4444
test.describe(title('action-sheet: Axe testing'), () => {
4545
test('should not have accessibility violations when header is defined', async ({ page }) => {
4646
await page.setContent(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const testAria = async (
2828
expect(ariaDescribedBy).toBe(expectedAriaDescribedBy);
2929
};
3030

31-
configs({ directions: ['ltr'], themes: ['dark', 'light'] }).forEach(({ title, config }) => {
31+
configs({ directions: ['ltr'], palettes: ['dark', 'light'] }).forEach(({ title, config }) => {
3232
test.describe(title('alert: Axe testing'), () => {
3333
test('should not have accessibility violations when header and message are defined', async ({ page }) => {
3434
await page.setContent(

core/src/components/alert/test/basic/alert.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ configs().forEach(({ config, screenshot, title }) => {
100100
});
101101
});
102102

103-
configs({ themes: ['light', 'dark'] }).forEach(({ config, screenshot, title }) => {
103+
configs({ palettes: ['light', 'dark'] }).forEach(({ config, screenshot, title }) => {
104104
test.describe(title('should not have visual regressions'), () => {
105105
test('more than two buttons', async ({ page }) => {
106106
await page.setContent(

core/src/components/back-button/test/a11y/back-button.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { configs, test } from '@utils/test/playwright';
55
/**
66
* Only ios mode uses ion-color() for the back button
77
*/
8-
configs({ directions: ['ltr'], modes: ['ios'], themes: ['light', 'dark'] }).forEach(({ title, config }) => {
8+
configs({ directions: ['ltr'], modes: ['ios'], palettes: ['light', 'dark'] }).forEach(({ title, config }) => {
99
test.describe(title('back-button: a11y for ion-color()'), () => {
1010
test('should not have accessibility violations', async ({ page }) => {
1111
await page.setContent(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
2525
});
2626
});
2727

28-
configs({ directions: ['ltr'], themes: ['light', 'dark'] }).forEach(({ config, title }) => {
28+
configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ config, title }) => {
2929
test.describe(title('badge: a11y'), () => {
3030
test('should not have accessibility violations', async ({ page }) => {
3131
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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'], themes: ['light', 'dark'] }).forEach(({ title, config }) => {
5+
configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ title, config }) => {
66
test.describe(title('button: a11y for ion-color()'), () => {
77
test('should not have accessibility violations', async ({ page }) => {
88
await page.setContent(
@@ -52,7 +52,7 @@ configs({ directions: ['ltr'], themes: ['light', 'dark'] }).forEach(({ title, co
5252
/**
5353
* Only ios mode uses ion-color() for the activated button state
5454
*/
55-
configs({ directions: ['ltr'], modes: ['ios'], themes: ['light', 'dark'] }).forEach(({ title, config }) => {
55+
configs({ directions: ['ltr'], modes: ['ios'], palettes: ['light', 'dark'] }).forEach(({ title, config }) => {
5656
test.describe(title('button: ios contrast'), () => {
5757
test('activated state should not have accessibility violations', async ({ page }) => {
5858
await page.setContent(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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'], themes: ['light', 'dark'] }).forEach(({ title, config }) => {
5+
configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ title, config }) => {
66
test.describe(title('checkbox: a11y'), () => {
77
test('should not have accessibility violations', async ({ page }) => {
88
await page.setContent(

core/src/components/fab-button/test/a11y/fab-button.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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'], themes: ['light', 'dark'] }).forEach(({ title, config }) => {
5+
configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ title, config }) => {
66
test.describe(title('fab-button: a11y'), () => {
77
test('should not have accessibility violations', async ({ page }) => {
88
await page.setContent(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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'], themes: ['light', 'dark'] }).forEach(({ title, config }) => {
5+
configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ title, config }) => {
66
test.describe(title('input: a11y'), () => {
77
test('default layout should not have accessibility violations', async ({ page }) => {
88
await page.setContent(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { configs, test } from '@utils/test/playwright';
44

55
import { testSlidingItem } from '../test.utils';
66

7-
configs({ directions: ['ltr'], themes: ['light', 'dark'] }).forEach(({ title, config }) => {
7+
configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ title, config }) => {
88
test.describe(title('item-sliding: a11y for ion-color()'), () => {
99
test('should not have accessibility violations', async ({ page }) => {
1010
await page.setContent(

0 commit comments

Comments
 (0)