Added new chip tests and baselines
@ -346,6 +346,7 @@ ion-chip,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "second
|
|||||||
ion-chip,prop,disabled,boolean,false,false,false
|
ion-chip,prop,disabled,boolean,false,false,false
|
||||||
ion-chip,prop,mode,"ios" | "md",undefined,false,false
|
ion-chip,prop,mode,"ios" | "md",undefined,false,false
|
||||||
ion-chip,prop,outline,boolean,false,false,false
|
ion-chip,prop,outline,boolean,false,false,false
|
||||||
|
ion-chip,prop,shape,"rectangular" | "round" | "soft" | undefined,undefined,false,true
|
||||||
ion-chip,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
ion-chip,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||||
ion-chip,css-prop,--background
|
ion-chip,css-prop,--background
|
||||||
ion-chip,css-prop,--color
|
ion-chip,css-prop,--color
|
||||||
|
|||||||
57
core/src/components/chip/test/shape/chip.e2e.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import { expect } from '@playwright/test';
|
||||||
|
import { configs, test } from '@utils/test/playwright';
|
||||||
|
|
||||||
|
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||||
|
/**
|
||||||
|
* This behavior only applies to Ionic Theme.
|
||||||
|
*/
|
||||||
|
test.describe(title('chip: shape'), () => {
|
||||||
|
test.describe('default', () => {
|
||||||
|
test('should not have visual regressions', async ({ page }) => {
|
||||||
|
await page.goto(`/src/components/chip/test/shape`, config);
|
||||||
|
|
||||||
|
await page.setIonViewport();
|
||||||
|
|
||||||
|
const container = page.locator('#default');
|
||||||
|
|
||||||
|
await expect(container).toHaveScreenshot(screenshot(`chip-round`));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('soft', () => {
|
||||||
|
test('should not have visual regressions', async ({ page }) => {
|
||||||
|
await page.goto(`/src/components/chip/test/shape`, config);
|
||||||
|
|
||||||
|
await page.setIonViewport();
|
||||||
|
|
||||||
|
const container = page.locator('#soft');
|
||||||
|
|
||||||
|
await expect(container).toHaveScreenshot(screenshot(`chip-soft`));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('round', () => {
|
||||||
|
test('should not have visual regressions', async ({ page }) => {
|
||||||
|
await page.goto(`/src/components/chip/test/shape`, config);
|
||||||
|
|
||||||
|
await page.setIonViewport();
|
||||||
|
|
||||||
|
const container = page.locator('#round');
|
||||||
|
|
||||||
|
await expect(container).toHaveScreenshot(screenshot(`chip-round`));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('rectangular', () => {
|
||||||
|
test('should not have visual regressions', async ({ page }) => {
|
||||||
|
await page.goto(`/src/components/chip/test/shape`, config);
|
||||||
|
|
||||||
|
await page.setIonViewport();
|
||||||
|
|
||||||
|
const container = page.locator('#rectangular');
|
||||||
|
|
||||||
|
await expect(container).toHaveScreenshot(screenshot(`chip-rectangular`));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 893 B |
59
core/src/components/chip/test/shape/index.html
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<title>Chip - Ionic States</title>
|
||||||
|
<meta
|
||||||
|
name="viewport"
|
||||||
|
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
||||||
|
/>
|
||||||
|
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
|
||||||
|
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
|
||||||
|
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||||
|
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||||
|
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<ion-app>
|
||||||
|
<ion-content>
|
||||||
|
<h2>Chip - Shape</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Shapes</h3>
|
||||||
|
<p>
|
||||||
|
<ion-chip id="default">
|
||||||
|
<ion-label>Default</ion-label>
|
||||||
|
</ion-chip>
|
||||||
|
<ion-chip id="soft" shape="soft">
|
||||||
|
<ion-label>Soft</ion-label>
|
||||||
|
</ion-chip>
|
||||||
|
<ion-chip id="round" shape="round">
|
||||||
|
<ion-label>Round</ion-label>
|
||||||
|
</ion-chip>
|
||||||
|
<ion-chip id="rectangular" shape="rectangular">
|
||||||
|
<ion-label>Rectangular</ion-label>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
|
</ion-app>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
ion-content {
|
||||||
|
--background: #222;
|
||||||
|
}
|
||||||
|
h2,
|
||||||
|
h3 {
|
||||||
|
color: #fff;
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-chip + ion-chip {
|
||||||
|
margin-inline-start: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -550,14 +550,14 @@ setting the checked property.
|
|||||||
|
|
||||||
|
|
||||||
@ProxyCmp({
|
@ProxyCmp({
|
||||||
inputs: ['color', 'disabled', 'mode', 'outline', 'theme']
|
inputs: ['color', 'disabled', 'mode', 'outline', 'shape', 'theme']
|
||||||
})
|
})
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-chip',
|
selector: 'ion-chip',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
template: '<ng-content></ng-content>',
|
template: '<ng-content></ng-content>',
|
||||||
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
||||||
inputs: ['color', 'disabled', 'mode', 'outline', 'theme'],
|
inputs: ['color', 'disabled', 'mode', 'outline', 'shape', 'theme'],
|
||||||
})
|
})
|
||||||
export class IonChip {
|
export class IonChip {
|
||||||
protected el: HTMLElement;
|
protected el: HTMLElement;
|
||||||
|
|||||||
@ -613,14 +613,14 @@ export declare interface IonCardTitle extends Components.IonCardTitle {}
|
|||||||
|
|
||||||
@ProxyCmp({
|
@ProxyCmp({
|
||||||
defineCustomElementFn: defineIonChip,
|
defineCustomElementFn: defineIonChip,
|
||||||
inputs: ['color', 'disabled', 'mode', 'outline', 'theme']
|
inputs: ['color', 'disabled', 'mode', 'outline', 'shape', 'theme']
|
||||||
})
|
})
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-chip',
|
selector: 'ion-chip',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
template: '<ng-content></ng-content>',
|
template: '<ng-content></ng-content>',
|
||||||
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
||||||
inputs: ['color', 'disabled', 'mode', 'outline', 'theme'],
|
inputs: ['color', 'disabled', 'mode', 'outline', 'shape', 'theme'],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
export class IonChip {
|
export class IonChip {
|
||||||
|
|||||||
@ -227,7 +227,8 @@ export const IonCheckbox = /*@__PURE__*/ defineContainer<JSX.IonCheckbox, JSX.Io
|
|||||||
export const IonChip = /*@__PURE__*/ defineContainer<JSX.IonChip>('ion-chip', defineIonChip, [
|
export const IonChip = /*@__PURE__*/ defineContainer<JSX.IonChip>('ion-chip', defineIonChip, [
|
||||||
'color',
|
'color',
|
||||||
'outline',
|
'outline',
|
||||||
'disabled'
|
'disabled',
|
||||||
|
'shape'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||