@@ -151,7 +151,7 @@ configs({ modes: ['ios', 'md'], directions: ['ltr'] }).forEach(({ title, screens
151151 */
152152configs ( { modes : [ 'ios' ] , directions : [ 'ltr' ] } ) . forEach ( ( { title, screenshot, config } ) => {
153153 test . describe ( title ( 'select: supporting text customization' ) , ( ) => {
154- test ( 'should not have visual regressions when rendering helper text with a custom color' , async ( { page } ) => {
154+ test ( 'should not have visual regressions when rendering helper text with a custom color via css parts ' , async ( { page } ) => {
155155 await page . setContent (
156156 `
157157 <style>
@@ -169,9 +169,25 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, c
169169 ) ;
170170
171171 const errorText = page . locator ( 'ion-select' ) ;
172- await expect ( errorText ) . toHaveScreenshot ( screenshot ( `select-helper-text-custom` ) ) ;
172+ await expect ( errorText ) . toHaveScreenshot ( screenshot ( `select-helper-text-custom-parts ` ) ) ;
173173 } ) ;
174- test ( 'should not have visual regressions when rendering error text with a custom color' , async ( { page } ) => {
174+ test ( 'should not have visual regressions when rendering helper text with a custom color via css var' , async ( { page } ) => {
175+ await page . setContent (
176+ `
177+ <style>
178+ ion-select.custom-select {
179+ --helper-text-color: green;
180+ }
181+ </style>
182+ <ion-select class="custom-select" label="Label" helper-text="Helper text"></ion-select>
183+ ` ,
184+ config
185+ ) ;
186+
187+ const helperText = page . locator ( 'ion-select' ) ;
188+ await expect ( helperText ) . toHaveScreenshot ( screenshot ( `select-helper-text-custom-color-var` ) ) ;
189+ } ) ;
190+ test ( 'should not have visual regressions when rendering error text with a custom color via css parts' , async ( { page } ) => {
175191 await page . setContent (
176192 `
177193 <style>
@@ -189,7 +205,39 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, c
189205 ) ;
190206
191207 const errorText = page . locator ( 'ion-select' ) ;
192- await expect ( errorText ) . toHaveScreenshot ( screenshot ( `select-error-text-custom` ) ) ;
208+ await expect ( errorText ) . toHaveScreenshot ( screenshot ( `select-error-text-custom-parts` ) ) ;
209+ } ) ;
210+ test ( 'should not have visual regressions when rendering error text with a custom color via css var' , async ( { page } ) => {
211+ await page . setContent (
212+ `
213+ <style>
214+ ion-select.custom-select {
215+ --error-text-color: purple;
216+ }
217+ </style>
218+ <ion-select class="ion-invalid ion-touched custom-select" label="Label" error-text="Error text"></ion-select>
219+ ` ,
220+ config
221+ ) ;
222+
223+ const errorText = page . locator ( 'ion-select' ) ;
224+ await expect ( errorText ) . toHaveScreenshot ( screenshot ( `select-error-text-custom-color-var` ) ) ;
225+ } ) ;
226+ test ( 'should not have visual regressions when rendering error text with a custom color via css highlight var' , async ( { page } ) => {
227+ await page . setContent (
228+ `
229+ <style>
230+ ion-select.custom-select {
231+ --highlight-color-invalid: purple;
232+ }
233+ </style>
234+ <ion-select class="ion-invalid ion-touched custom-select" label="Label" error-text="Error text"></ion-select>
235+ ` ,
236+ config
237+ ) ;
238+
239+ const errorText = page . locator ( 'ion-select' ) ;
240+ await expect ( errorText ) . toHaveScreenshot ( screenshot ( `select-error-text-custom-highlight-var` ) ) ;
193241 } ) ;
194242 } ) ;
195243} ) ;
0 commit comments