@@ -25,13 +25,15 @@ describe('toggling dropdown', () => {
2525 expect ( comboBox . opened ) . to . be . false ;
2626 tap ( comboBox . querySelector ( '[slot="label"]' ) ) ;
2727 expect ( comboBox . opened ) . to . be . true ;
28+ expect ( overlay . opened ) . to . be . true ;
2829 } ) ;
2930
3031 it ( 'should not open synchronously by clicking label when autoOpenDisabled is true' , ( ) => {
3132 comboBox . autoOpenDisabled = true ;
3233 expect ( comboBox . opened ) . to . be . false ;
3334 tap ( comboBox . querySelector ( '[slot="label"]' ) ) ;
3435 expect ( comboBox . opened ) . to . be . false ;
36+ expect ( overlay . opened ) . to . be . false ;
3537 } ) ;
3638
3739 it ( 'should restore attribute focus-ring if it was initially set before opening and combo-box is focused' , ( ) => {
@@ -45,19 +47,22 @@ describe('toggling dropdown', () => {
4547 expect ( comboBox . opened ) . to . be . false ;
4648 tap ( input ) ;
4749 expect ( comboBox . opened ) . to . be . true ;
50+ expect ( overlay . opened ) . to . be . true ;
4851 } ) ;
4952
5053 it ( 'should not open synchronously by clicking input when autoOpenDisabled is true' , ( ) => {
5154 comboBox . autoOpenDisabled = true ;
5255 expect ( comboBox . opened ) . to . be . false ;
5356 tap ( input ) ;
5457 expect ( comboBox . opened ) . to . be . false ;
58+ expect ( overlay . opened ) . to . be . false ;
5559 } ) ;
5660
5761 it ( 'should open by clicking icon' , ( ) => {
5862 clickToggleIcon ( ) ;
5963
6064 expect ( comboBox . opened ) . to . be . true ;
65+ expect ( overlay . opened ) . to . be . true ;
6166 } ) ;
6267
6368 it ( 'should open by clicking icon when autoOpenDisabled is true and input is invalid' , ( ) => {
@@ -103,6 +108,7 @@ describe('toggling dropdown', () => {
103108 comboBox . open ( ) ;
104109
105110 expect ( comboBox . opened ) . to . be . true ;
111+ expect ( overlay . opened ) . to . be . true ;
106112 } ) ;
107113
108114 it ( 'should set body `pointer-events: none` on open and restore initial value on close' , ( ) => {
@@ -127,22 +133,31 @@ describe('toggling dropdown', () => {
127133 expect ( comboBox . opened ) . to . be . true ;
128134 } ) ;
129135
130- it ( 'should be hidden with null items' , ( ) => {
136+ it ( 'should not open overlay when setting items to null ' , ( ) => {
131137 comboBox . items = null ;
132138
133139 comboBox . open ( ) ;
134140
135141 expect ( comboBox . opened ) . to . be . true ;
136- expect ( overlay . hasAttribute ( 'hidden' ) ) . to . be . true ;
142+ expect ( overlay . opened ) . to . be . false ;
137143 } ) ;
138144
139- it ( 'should be hidden with no items' , ( ) => {
145+ it ( 'should not open overlay when setting empty items array ' , ( ) => {
140146 comboBox . items = [ ] ;
141147
142148 comboBox . open ( ) ;
143149
144150 expect ( comboBox . opened ) . to . be . true ;
145- expect ( overlay . hasAttribute ( 'hidden' ) ) . to . be . true ;
151+ expect ( overlay . opened ) . to . be . false ;
152+ } ) ;
153+
154+ it ( 'should not open overlay when setting empty filteredItems array' , ( ) => {
155+ comboBox . filteredItems = [ ] ;
156+
157+ comboBox . open ( ) ;
158+
159+ expect ( comboBox . opened ) . to . be . true ;
160+ expect ( overlay . opened ) . to . be . false ;
146161 } ) ;
147162
148163 ( isIOS ? describe : describe . skip ) ( 'after opening' , ( ) => {
@@ -223,7 +238,7 @@ describe('toggling dropdown', () => {
223238
224239 focusout ( input ) ;
225240
226- expect ( comboBox . opened ) . to . equal ( false ) ;
241+ expect ( comboBox . opened ) . to . be . false ;
227242 } ) ;
228243
229244 it ( 'should restore focus to the field on outside click' , async ( ) => {
@@ -323,24 +338,6 @@ describe('toggling dropdown', () => {
323338 } ) ;
324339 } ) ;
325340
326- describe ( 'empty list' , ( ) => {
327- it ( 'vaadin-combo-box-overlay should not be attached when filteredItems is empty' , ( ) => {
328- comboBox . open ( ) ;
329- expect ( comboBox . opened ) . to . be . true ;
330- expect ( document . querySelector ( 'vaadin-combo-box-overlay' ) ) . to . be . ok ;
331- comboBox . close ( ) ;
332- expect ( comboBox . opened ) . to . be . false ;
333- expect ( document . querySelector ( 'vaadin-combo-box-overlay' ) ) . not . to . be . ok ;
334-
335- comboBox . filteredItems = [ ] ;
336- comboBox . open ( ) ;
337- expect ( comboBox . opened ) . to . be . true ;
338- expect ( document . querySelector ( 'vaadin-combo-box-overlay' ) ) . not . to . be . ok ;
339- comboBox . close ( ) ;
340- expect ( comboBox . opened ) . to . be . false ;
341- } ) ;
342- } ) ;
343-
344341 ( isIOS ? describe : describe . skip ) ( 'external focus (initially)' , ( ) => {
345342 let input , blurSpy ;
346343
0 commit comments