Merge remote-tracking branch 'origin/main' into chore/sync-with-main-6

This commit is contained in:
amandaesmith3
2023-05-05 13:30:21 -05:00
1333 changed files with 8602 additions and 6610 deletions

View File

@ -1,29 +0,0 @@
import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';
test.describe('text: basic', () => {
test.beforeEach(({ skip }) => {
skip.rtl();
skip.mode('ios', 'Text does not have per-mode styles');
});
test('should render default text', async ({ page }) => {
await page.setContent(`
<ion-text>
<strong>The quick brown fox <ion-text><sup>jumps</sup></ion-text> over the <ion-text><sub>lazy dog</sub></ion-text></strong>
</ion-text>
`);
const text = page.locator('ion-text');
await expect(text.nth(0)).toHaveScreenshot(`text-${page.getSnapshotSettings()}.png`);
});
test('should render text with color prop', async ({ page }) => {
await page.setContent(`
<ion-text color="primary">
<strong>The quick brown fox <ion-text color="success"><sup>jumps</sup></ion-text> over the <ion-text color="danger"><sub>lazy dog</sub></ion-text></strong>
</ion-text>
`);
const text = page.locator('ion-text');
await expect(text.nth(0)).toHaveScreenshot(`text-color-${page.getSnapshotSettings()}.png`);
});
});

View File

@ -0,0 +1,36 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
/**
* Text does not have per-mode styles
*/
configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('text: basic'), () => {
test('should render default text', async ({ page }) => {
await page.setContent(
`
<ion-text>
<strong>The quick brown fox <ion-text><sup>jumps</sup></ion-text> over the <ion-text><sub>lazy dog</sub></ion-text></strong>
</ion-text>
`,
config
);
const text = page.locator('ion-text');
await expect(text.nth(0)).toHaveScreenshot(screenshot(`text`));
});
test('should render text with color prop', async ({ page }) => {
await page.setContent(
`
<ion-text color="primary">
<strong>The quick brown fox <ion-text color="success"><sup>jumps</sup></ion-text> over the <ion-text color="danger"><sub>lazy dog</sub></ion-text></strong>
</ion-text>
`,
config
);
const text = page.locator('ion-text');
await expect(text.nth(0)).toHaveScreenshot(screenshot(`text-color`));
});
});
});