@@ -6,7 +6,7 @@ import chaiDom from 'chai-dom';
6
6
import type { ReactElement } from 'react' ;
7
7
import { ListBox } from '../src/ListBox.js' ;
8
8
import { Item } from '../src/Item.js' ;
9
- import { Select } from '../src/Select.js' ;
9
+ import { Select , SelectElement } from '../src/Select.js' ;
10
10
import { findByQuerySelector } from './utils/findByQuerySelector.js' ;
11
11
12
12
useChaiPlugin ( chaiDom ) ;
@@ -143,4 +143,29 @@ describe('Select', () => {
143
143
await expect ( findByQuerySelector ( 'div[slot="prefix"]' ) ) . to . eventually . have . text ( 'Value:' ) ;
144
144
} ) ;
145
145
} ) ;
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
+ } ) ;
146
171
} ) ;
0 commit comments