Merge remote-tracking branch 'origin/main' into chore/sync-with-main-6
@ -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`);
|
||||
});
|
||||
});
|
||||
36
core/src/components/text/test/basic/text.e2e.ts
Normal 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`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |