@@ -7,68 +7,25 @@ import { configs, test } from '@utils/test/playwright';
77 */
88configs ( { modes : [ 'ionic-md' ] , directions : [ 'ltr' ] } ) . forEach ( ( { title, screenshot, config } ) => {
99 test . describe ( title ( 'textarea: rows' ) , ( ) => {
10- test ( 'should respect rows attribute' , async ( { page } ) => {
11- await page . setContent (
12- `
13- <ion-textarea
14- rows="3"
15- label="Comments"
16- value="1 2 3 4 5 6 7 8 9 0"
17- ></ion-textarea>
18- ` ,
19- config
20- ) ;
21-
22- const textarea = page . locator ( 'ion-textarea' ) ;
23- await expect ( textarea ) . toHaveScreenshot ( screenshot ( `textarea-rows-3` ) ) ;
24- } ) ;
25-
2610 test ( 'should respect rows attribute with different values' , async ( { page } ) => {
2711 await page . setContent (
2812 `
2913 <div id="container" style="display: flex; flex-direction: column; gap: 20px;">
14+ <h2>Rows: 1</h2>
3015 <ion-textarea
3116 rows="1"
3217 label="Small"
3318 value="1 2 3 4 5 6 7 8 9 0"
3419 ></ion-textarea>
35- <ion-textarea
36- rows="1"
37- label="Medium"
38- value="1 2 3 4 5 6 7 8 9 0"
39- ></ion-textarea>
40- <ion-textarea
41- rows="1"
42- label="Large"
43- value="1 2 3 4 5 6 7 8 9 0"
44- ></ion-textarea>
45- <ion-textarea
46- rows="3"
47- label="Small"
48- value="1 2 3 4 5 6 7 8 9 0"
49- ></ion-textarea>
20+ <h2>Rows: 3</h2>
5021 <ion-textarea
5122 rows="3"
5223 label="Medium"
5324 value="1 2 3 4 5 6 7 8 9 0"
5425 ></ion-textarea>
26+ <h2>Rows: 8</h2>
5527 <ion-textarea
56- rows="3"
57- label="Large"
58- value="1 2 3 4 5 6 7 8 9 0"
59- ></ion-textarea>
60- <ion-textarea
61- rows="5"
62- label="Small"
63- value="1 2 3 4 5 6 7 8 9 0"
64- ></ion-textarea>
65- <ion-textarea
66- rows="5"
67- label="Medium"
68- value="1 2 3 4 5 6 7 8 9 0"
69- ></ion-textarea>
70- <ion-textarea
71- rows="5"
28+ rows="8"
7229 label="Large"
7330 value="1 2 3 4 5 6 7 8 9 0"
7431 ></ion-textarea>
@@ -85,18 +42,21 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh
8542 await page . setContent (
8643 `
8744 <div id="container" style="display: flex; flex-direction: column; gap: 20px;">
45+ <h2>Rows: 3, Size Small</h2>
8846 <ion-textarea
8947 rows="3"
9048 size="small"
9149 label="Small Size"
9250 value="1 2 3 4 5 6 7 8 9 0"
9351 ></ion-textarea>
52+ <h2>Rows: 3, Size Medium</h2>
9453 <ion-textarea
9554 rows="3"
9655 size="medium"
9756 label="Medium Size"
9857 value="1 2 3 4 5 6 7 8 9 0"
9958 ></ion-textarea>
59+ <h2>Rows: 3, Size Large</h2>
10060 <ion-textarea
10161 rows="3"
10262 size="large"
@@ -112,56 +72,24 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh
11272 await expect ( container ) . toHaveScreenshot ( screenshot ( `textarea-rows-different-sizes` ) ) ;
11373 } ) ;
11474
115- test ( 'should respect rows attribute with value content' , async ( { page } ) => {
116- await page . setContent (
117- `
118- <ion-textarea
119- rows="3"
120- label="Comments"
121- value="1 2 3 4 5 6 7 8 9 0"
122- ></ion-textarea>
123- ` ,
124- config
125- ) ;
126-
127- const textarea = page . locator ( 'ion-textarea' ) ;
128- await expect ( textarea ) . toHaveScreenshot ( screenshot ( `textarea-rows-3-with-value` ) ) ;
129- } ) ;
130-
13175 test ( 'should respect rows when auto-grow is enabled' , async ( { page } ) => {
13276 await page . setContent (
13377 `
134- <ion-textarea
135- rows="3"
136- auto-grow="true"
137- label="Comments"
138- value="1 2 3 4 5 6 7 8 9 0"
139- ></ion-textarea>
140- ` ,
141- config
142- ) ;
143-
144- const textarea = page . locator ( 'ion-textarea' ) ;
145- await expect ( textarea ) . toHaveScreenshot ( screenshot ( `textarea-rows-3-autogrow` ) ) ;
146- } ) ;
147-
148- test ( 'should respect rows with start and end slot icons' , async ( { page } ) => {
149- await page . setContent (
150- `
151- <ion-textarea
152- rows="3"
153- label="Comments"
154- value="1 2 3 4 5 6 7 8 9 0"
155- >
156- <ion-icon slot="start" name="lock-closed" aria-hidden="true"></ion-icon>
157- <ion-icon slot="end" name="square-outline" aria-hidden="true"></ion-icon>
158- </ion-textarea>
78+ <div id="container" style="display: flex; flex-direction: column; gap: 20px;">
79+ <h2>Rows: 3, Auto-grow</h2>
80+ <ion-textarea
81+ rows="3"
82+ auto-grow="true"
83+ label="Comments"
84+ value="1 2 3 4 5 6 7 8 9 0"
85+ ></ion-textarea>
86+ </div>
15987 ` ,
16088 config
16189 ) ;
16290
163- const textarea = page . locator ( 'ion-textarea ' ) ;
164- await expect ( textarea ) . toHaveScreenshot ( screenshot ( `textarea-rows-3-end-slot-icon ` ) ) ;
91+ const container = page . locator ( '#container ' ) ;
92+ await expect ( container ) . toHaveScreenshot ( screenshot ( `textarea-rows-autogrow ` ) ) ;
16593 } ) ;
16694 } ) ;
16795} ) ;
0 commit comments