Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 13.3k
test(button): ionic theme tests#29201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import { configs, test } from '@utils/test/playwright'; | ||
| configs().forEach(({ title, config, screenshot }) => { | ||
| test.describe(title('button: clear'), () => { | ||
| /** | ||
| * Fill="clear" does not render differently based on the direction. | ||
| */ | ||
| configs({ directions: ['ltr'], themes: ['ios', 'md', 'ionic'] }).forEach(({ title, config, screenshot }) => { | ||
| test.describe(title('button: fill: clear'), () => { | ||
| test('should not have visual regressions', async ({ page }) => { | ||
| await page.goto(`/src/components/button/test/clear`, config); | ||
| await page.setIonViewport(); | ||
| await expect(page).toHaveScreenshot(screenshot(`button-clear`)); | ||
| await expect(page).toHaveScreenshot(screenshot(`button-fill-clear`)); | ||
| }); | ||
| }); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
joselrio marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import { configs, test } from '@utils/test/playwright'; | ||
| /** | ||
| * All content takes up the full width, so RTL has no effect. | ||
| */ | ||
| configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | ||
joselrio marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| test.describe(title('button: shape'), () => { | ||
| test.describe('round', () => { | ||
| test.describe('default', () => { | ||
| test('should not have visual regressions', async ({ page }) => { | ||
| await page.goto(`/src/components/button/test/shape`, config); | ||
| await page.setIonViewport(); | ||
| const container = page.locator('#default'); | ||
| await expect(container).toHaveScreenshot(screenshot(`button-round`)); | ||
| }); | ||
| }); | ||
| test.describe('outline', () => { | ||
| test('should not have visual regressions', async ({ page }) => { | ||
| await page.goto(`/src/components/button/test/shape`, config); | ||
| await page.setIonViewport(); | ||
| const container = page.locator('#outline'); | ||
| await expect(container).toHaveScreenshot(screenshot(`button-outline-round`)); | ||
| }); | ||
| }); | ||
| test.describe('clear', () => { | ||
| test('should not have visual regressions', async ({ page }) => { | ||
| await page.goto(`/src/components/button/test/shape`, config); | ||
| await page.setIonViewport(); | ||
| const container = page.locator('#clear'); | ||
| await expect(container).toHaveScreenshot(screenshot(`button-clear-round`)); | ||
| }); | ||
| }); | ||
| test.describe('color', () => { | ||
| test('should not have visual regressions', async ({ page }) => { | ||
| await page.goto(`/src/components/button/test/shape`, config); | ||
| await page.setIonViewport(); | ||
| const container = page.locator('#color'); | ||
| await expect(container).toHaveScreenshot(screenshot(`button-color-round`)); | ||
| }); | ||
| }); | ||
| test.describe('expand', () => { | ||
| test('should not have visual regressions', async ({ page }) => { | ||
| await page.goto(`/src/components/button/test/shape`, config); | ||
| await page.setIonViewport(); | ||
| const container = page.locator('#expand'); | ||
| await expect(container).toHaveScreenshot(screenshot(`button-expand-round`)); | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
| /** | ||
| * Shape="rectangular" is only available in the Ionic theme. | ||
| */ | ||
| configs({ directions: ['ltr'], themes: ['ionic'] }).forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('button: shape'), () => { | ||
| test.describe('rectangular', () => { | ||
| test('should not have visual regressions', async ({ page }) => { | ||
| await page.setContent( | ||
| ` | ||
| <style> | ||
| ion-button { | ||
| margin: 8px; | ||
| } | ||
| </style> | ||
| <div id="container"> | ||
| <ion-button shape="rectangular" fill="solid">Rectangular Button, Solid</ion-button> | ||
| <ion-button class="ion-focused" shape="rectangular" fill="solid">Rectangular Button, Solid, Focused</ion-button> | ||
| <ion-button class="ion-activated" shape="rectangular" fill="solid">Rectangular Button, Solid, Activated</ion-button> | ||
| <ion-button shape="rectangular" fill="outline">Rectangular Button, Outline</ion-button> | ||
| <ion-button class="ion-focused" shape="rectangular" fill="outline">Rectangular Button, Outline, Focused</ion-button> | ||
| <ion-button class="ion-activated" shape="rectangular" fill="outline">Rectangular Button, Outline, Activated</ion-button> | ||
| <ion-button shape="rectangular" fill="clear">Rectangular Button</ion-button> | ||
| <ion-button class="ion-focused" shape="rectangular" fill="clear">Rectangular Button, Focused</ion-button> | ||
| <ion-button class="ion-activated" shape="rectangular" fill="clear">Rectangular Button, Activated</ion-button> | ||
| </div> | ||
| `, | ||
| config | ||
| ); | ||
| const container = page.locator('#container'); | ||
| await expect(container).toHaveScreenshot(screenshot(`button-shape-rectangular`)); | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.