Skip to content

Commit 42b2a76

Browse files
committed
fix(input): update background placement for ionic
1 parent 2af2167 commit 42b2a76

File tree

50 files changed

+58
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+58
-38
lines changed

core/src/components/textarea/test/fill/textarea.e2e.ts

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { expect } from '@playwright/test';
22
import { configs, test } from '@utils/test/playwright';
33

44
/**
5-
* Fill is only available in MD mode
5+
* Fill is only available in MD and Ionic
66
*/
7-
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
7+
configs({ modes: ['md', 'ionic-md'] }).forEach(({ title, screenshot, config }) => {
88
test.describe(title('textarea: fill'), () => {
99
test.describe('textarea: fill solid', () => {
1010
test('should not have visual regressions', async ({ page }) => {
@@ -25,25 +25,6 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
2525
const textarea = page.locator('ion-textarea');
2626
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid`));
2727
});
28-
test('should render correctly with floating label', async ({ page }) => {
29-
await page.setContent(
30-
`
31-
<ion-textarea
32-
fill="solid"
33-
label="Email"
34-
label-placement="floating"
35-
36-
helper-text="Enter your email"
37-
maxlength="20"
38-
counter="true"
39-
></ion-textarea>
40-
`,
41-
config
42-
);
43-
44-
const textarea = page.locator('ion-textarea');
45-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid-label-floating`));
46-
});
4728
test('should not have visual regressions with shaped solid', async ({ page }) => {
4829
await page.setContent(
4930
`
@@ -63,11 +44,12 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
6344
const textarea = page.locator('ion-textarea');
6445
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-solid`));
6546
});
66-
test('padding and border radius should be customizable', async ({ page }) => {
47+
test('padding, border radius, and background should be customizable', async ({ page }) => {
6748
await page.setContent(
6849
`
6950
<style>
7051
ion-textarea {
52+
--background: #e5e5e5 !important;
7153
--border-radius: 10px !important;
7254
--padding-start: 50px !important;
7355
--padding-end: 50px !important;
@@ -78,7 +60,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
7860
shape="round"
7961
fill="solid"
8062
label="Email"
81-
label-placement="floating"
63+
label-placement="stacked"
8264
8365
helper-text="Enter your email"
8466
maxlength="20"
@@ -111,13 +93,13 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
11193
const textarea = page.locator('ion-textarea');
11294
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline`));
11395
});
114-
test('should render correctly with floating label', async ({ page }) => {
96+
test('should not have visual regressions with shaped outline', async ({ page }) => {
11597
await page.setContent(
11698
`
11799
<ion-textarea
100+
shape="round"
118101
fill="outline"
119102
label="Email"
120-
label-placement="floating"
121103
122104
helper-text="Enter your email"
123105
maxlength="20"
@@ -128,15 +110,25 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
128110
);
129111

130112
const textarea = page.locator('ion-textarea');
131-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-label-floating`));
113+
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline`));
132114
});
133-
test('should not have visual regressions with shaped outline', async ({ page }) => {
115+
test('padding, border radius, and background should be customizable', async ({ page }) => {
134116
await page.setContent(
135117
`
118+
<style>
119+
ion-textarea {
120+
--background: #e5e5e5 !important;
121+
--border-radius: 10px !important;
122+
--padding-start: 50px !important;
123+
--padding-end: 50px !important;
124+
}
125+
</style>
126+
136127
<ion-textarea
137128
shape="round"
138129
fill="outline"
139130
label="Email"
131+
label-placement="stacked"
140132
141133
helper-text="Enter your email"
142134
maxlength="20"
@@ -147,21 +139,43 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
147139
);
148140

149141
const textarea = page.locator('ion-textarea');
150-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline`));
142+
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline-custom`));
151143
});
152-
test('padding and border radius should be customizable', async ({ page }) => {
144+
});
145+
});
146+
});
147+
148+
/**
149+
* Fill with floating label is only available in MD mode
150+
*/
151+
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
152+
test.describe(title('textarea: fill'), () => {
153+
test.describe('textarea: fill solid', () => {
154+
test('should render correctly with floating label', async ({ page }) => {
153155
await page.setContent(
154156
`
155-
<style>
156-
ion-textarea {
157-
--border-radius: 10px !important;
158-
--padding-start: 50px !important;
159-
--padding-end: 50px !important;
160-
}
161-
</style>
157+
<ion-textarea
158+
fill="solid"
159+
label="Email"
160+
label-placement="floating"
161+
162+
helper-text="Enter your email"
163+
maxlength="20"
164+
counter="true"
165+
></ion-textarea>
166+
`,
167+
config
168+
);
162169

170+
const textarea = page.locator('ion-textarea');
171+
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid-label-floating`));
172+
});
173+
});
174+
test.describe('textarea: fill outline', () => {
175+
test('should render correctly with floating label', async ({ page }) => {
176+
await page.setContent(
177+
`
163178
<ion-textarea
164-
shape="round"
165179
fill="outline"
166180
label="Email"
167181
label-placement="floating"
@@ -175,7 +189,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
175189
);
176190

177191
const textarea = page.locator('ion-textarea');
178-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline-custom`));
192+
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-label-floating`));
179193
});
180194
});
181195
});

0 commit comments

Comments
 (0)