Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 38 additions & 60 deletions core/src/components/textarea/test/fill/textarea.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

/**
* Fill is only available in MD mode
* Fill is only available in MD and Ionic
*/
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
configs({ modes: ['md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('textarea: fill'), () => {
test.describe('textarea: fill solid', () => {
test('should not have visual regressions', async ({ page }) => {
Expand All @@ -13,6 +13,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
<ion-textarea
fill="solid"
label="Email"
label-placement="stacked"
value="[email protected]"
helper-text="Enter your email"
maxlength="20"
Expand All @@ -25,49 +26,12 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid`));
});
test('should render correctly with floating label', async ({ page }) => {
await page.setContent(
`
<ion-textarea
fill="solid"
label="Email"
label-placement="floating"
value="[email protected]"
helper-text="Enter your email"
maxlength="20"
counter="true"
></ion-textarea>
`,
config
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid-label-floating`));
});
test('should not have visual regressions with shaped solid', async ({ page }) => {
await page.setContent(
`
<ion-textarea
shape="round"
fill="solid"
label="Email"
value="[email protected]"
helper-text="Enter your email"
maxlength="20"
counter="true"
></ion-textarea>
`,
config
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-solid`));
});
test('padding and border radius should be customizable', async ({ page }) => {
test('padding, border radius, and background should be customizable', async ({ page }) => {
await page.setContent(
`
<style>
ion-textarea {
--background: #e5e5e5 !important;
--border-radius: 10px !important;
--padding-start: 50px !important;
--padding-end: 50px !important;
Expand All @@ -78,7 +42,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
shape="round"
fill="solid"
label="Email"
label-placement="floating"
label-placement="stacked"
value="[email protected]"
helper-text="Enter your email"
maxlength="20"
Expand All @@ -99,6 +63,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
<ion-textarea
fill="outline"
label="Email"
label-placement="stacked"
value="[email protected]"
helper-text="Enter your email"
maxlength="20"
Expand All @@ -111,13 +76,23 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline`));
});
test('should render correctly with floating label', async ({ page }) => {
test('padding, border radius, and background should be customizable', async ({ page }) => {
await page.setContent(
`
<style>
ion-textarea {
--background: #e5e5e5 !important;
--border-radius: 10px !important;
--padding-start: 50px !important;
--padding-end: 50px !important;
}
</style>

<ion-textarea
shape="round"
fill="outline"
label="Email"
label-placement="floating"
label-placement="stacked"
value="[email protected]"
helper-text="Enter your email"
maxlength="20"
Expand All @@ -128,15 +103,25 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-label-floating`));
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline-custom`));
});
test('should not have visual regressions with shaped outline', async ({ page }) => {
});
});
});

/**
* Fill with floating label is only available in MD mode
*/
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('textarea: fill'), () => {
test.describe('textarea: fill solid', () => {
test('should render correctly with floating label', async ({ page }) => {
await page.setContent(
`
<ion-textarea
shape="round"
fill="outline"
fill="solid"
label="Email"
label-placement="floating"
value="[email protected]"
helper-text="Enter your email"
maxlength="20"
Expand All @@ -147,21 +132,14 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline`));
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid-label-floating`));
});
test('padding and border radius should be customizable', async ({ page }) => {
});
test.describe('textarea: fill outline', () => {
test('should render correctly with floating label', async ({ page }) => {
await page.setContent(
`
<style>
ion-textarea {
--border-radius: 10px !important;
--padding-start: 50px !important;
--padding-end: 50px !important;
}
</style>

<ion-textarea
shape="round"
fill="outline"
label="Email"
label-placement="floating"
Expand All @@ -175,7 +153,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline-custom`));
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-label-floating`));
});
});
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
32 changes: 32 additions & 0 deletions core/src/components/textarea/test/shape/textarea.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

/**
* This behavior does not vary across directions.
* The round shape is only available in the Ionic and Material Design themes.
* Shapes with different fill types are only available in the Material Design theme.
*/
configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('textarea: shape'), () => {
test.describe('fill: solid', () => {
test.describe('round', () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<ion-textarea
shape="round"
fill="solid"
label="Email"
label-placement="stacked"
value="[email protected]"
></ion-textarea>
`,
config
);

const textarea = page.locator('ion-textarea');

await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid-shape-round`));
});
});
});
});
});

/**
* This behavior does not vary across directions
* The round shape is only available in the Ionic and Material Design themes
Expand Down
6 changes: 6 additions & 0 deletions core/src/components/textarea/textarea.ionic.outline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
// Textarea Fill: Outline, Textarea Wrapper
// ----------------------------------------------------------------

:host(.textarea-fill-outline) .textarea-wrapper {
background: initial;
}

:host(.textarea-fill-outline) .textarea-wrapper-inner {
/**
* The border should be relative to the inner wrapper
Expand All @@ -34,6 +38,8 @@
pointer-events: none;

border: var(--border-width) var(--border-style) var(--border-color);

background: var(--background);
}

// Textarea Fill: Outline, Bottom Content
Expand Down
Loading