@@ -6,7 +6,7 @@ import chaiDom from 'chai-dom';
66import type { ReactElement } from 'react' ;
77import { ListBox } from '../src/ListBox.js' ;
88import { Item } from '../src/Item.js' ;
9- import { Select } from '../src/Select.js' ;
9+ import { Select , SelectElement } from '../src/Select.js' ;
1010import { findByQuerySelector } from './utils/findByQuerySelector.js' ;
1111
1212useChaiPlugin ( chaiDom ) ;
@@ -143,4 +143,29 @@ describe('Select', () => {
143143 await expect ( findByQuerySelector ( 'div[slot="prefix"]' ) ) . to . eventually . have . text ( 'Value:' ) ;
144144 } ) ;
145145 } ) ;
146+
147+ describe ( 'boolean property' , ( ) => {
148+ const booleanProperties : Array < keyof typeof SelectElement . prototype & string > = [
149+ 'disabled' ,
150+ 'hidden' ,
151+ 'opened' ,
152+ 'draggable' ,
153+ ] ;
154+
155+ booleanProperties . forEach ( ( property ) => {
156+ describe ( property , ( ) => {
157+ it ( `should be true in the element if ${ property } prop is true` , async ( ) => {
158+ render ( < Select items = { [ { label : 'foo' , value : 'foo' } ] } { ...{ [ property ] : true } } /> ) ;
159+ const select = await findByQuerySelector ( 'vaadin-select' ) ;
160+ expect ( select [ property ] ) . to . be . ok ;
161+ } ) ;
162+
163+ it ( `should be false in the element if ${ property } prop is false` , async ( ) => {
164+ render ( < Select items = { [ { label : 'foo' , value : 'foo' } ] } { ...{ [ property ] : false } } /> ) ;
165+ const select = await findByQuerySelector ( 'vaadin-select' ) ;
166+ expect ( select [ property ] ) . not . to . be . ok ;
167+ } ) ;
168+ } ) ;
169+ } ) ;
170+ } ) ;
146171} ) ;
0 commit comments