@@ -73,6 +73,57 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
7373 await expect ( wrapper ) . toHaveScreenshot ( screenshot ( `select-custom-parts-diff` ) ) ;
7474 } ) ;
7575
76+ test ( 'should be able to customize wrapper and bottom using css parts' , async ( { page } ) => {
77+ test . info ( ) . annotations . push ( {
78+ type : 'issue' ,
79+ description : 'https://github.com/ionic-team/ionic-framework/issues/29918' ,
80+ } ) ;
81+
82+ await page . setContent (
83+ `
84+ <style>
85+ ion-select::part(wrapper) {
86+ background-color: red;
87+ }
88+
89+ ion-select::part(inner) {
90+ background-color: orange;
91+ }
92+
93+ ion-select::part(bottom) {
94+ background-color: green;
95+ }
96+ </style>
97+
98+ <ion-select label="Select" label-placement="stacked" placeholder="Fruits" helper-text="Helper text">
99+ <ion-select-option value="a">Apple</ion-select-option>
100+ </ion-select>
101+ ` ,
102+ config
103+ ) ;
104+
105+ const select = page . locator ( 'ion-select' ) ;
106+ const wrapper = select . locator ( '.select-wrapper' ) ;
107+ const wrapperInner = select . locator ( '.select-wrapper-inner' ) ;
108+ const bottom = select . locator ( '.select-bottom' ) ;
109+
110+ const wrapperBackgroundColor = await wrapper . evaluate ( ( el ) => {
111+ return window . getComputedStyle ( el ) . backgroundColor ;
112+ } ) ;
113+
114+ const wrapperInnerBackgroundColor = await wrapperInner . evaluate ( ( el ) => {
115+ return window . getComputedStyle ( el ) . backgroundColor ;
116+ } ) ;
117+
118+ const bottomBackgroundColor = await bottom . evaluate ( ( el ) => {
119+ return window . getComputedStyle ( el ) . backgroundColor ;
120+ } ) ;
121+
122+ expect ( wrapperBackgroundColor ) . toBe ( 'rgb(255, 0, 0)' ) ;
123+ expect ( wrapperInnerBackgroundColor ) . toBe ( 'rgb(255, 165, 0)' ) ;
124+ expect ( bottomBackgroundColor ) . toBe ( 'rgb(0, 128, 0)' ) ;
125+ } ) ;
126+
76127 test ( 'should render custom cancel text when prop is provided with alert interface' , async ( { page } ) => {
77128 await page . setContent (
78129 `
0 commit comments