File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
core/src/components/select/test Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -125,3 +125,35 @@ describe('select: slot interactivity', () => {
125125 expect ( divSpy ) . toHaveBeenCalled ( ) ;
126126 } ) ;
127127} ) ;
128+
129+ describe ( 'ion-select: required' , ( ) => {
130+ it ( 'should have a aria-required attribute as true in inner button' , async ( ) => {
131+ const page = await newSpecPage ( {
132+ components : [ Select ] ,
133+ html : `
134+ <ion-select required="true"></ion-select>
135+ ` ,
136+ } ) ;
137+
138+ const select = page . body . querySelector ( 'ion-select' ) ! ;
139+
140+ const nativeButton = select . shadowRoot ! . querySelector ( 'button' ) ! ;
141+
142+ expect ( nativeButton . getAttribute ( 'aria-required' ) ) . toBe ( 'true' ) ;
143+ } ) ;
144+
145+ it ( 'should not have a aria-required attribute as false in inner button' , async ( ) => {
146+ const page = await newSpecPage ( {
147+ components : [ Select ] ,
148+ html : `
149+ <ion-select required="false"></ion-select>
150+ ` ,
151+ } ) ;
152+
153+ const select = page . body . querySelector ( 'ion-select' ) ! ;
154+
155+ const nativeButton = select . shadowRoot ! . querySelector ( 'button' ) ! ;
156+
157+ expect ( nativeButton . getAttribute ( 'aria-required' ) ) . toBe ( 'false' ) ;
158+ } ) ;
159+ } ) ;
You can’t perform that action at this time.
0 commit comments