@@ -221,45 +221,6 @@ const TEMPLATES = {
221
221
expect ( pages ) . to . contain ( 2 ) ;
222
222
} ) ;
223
223
224
- it ( 'should request with empty filter' , ( ) => {
225
- comboBox . dataProvider = spyDataProvider ;
226
- const params = spyDataProvider . lastCall . args [ 0 ] ;
227
- expect ( params . filter ) . to . equal ( '' ) ;
228
- } ) ;
229
-
230
- it ( 'should request on filter change with user’s filter' , ( ) => {
231
- comboBox . dataProvider = spyDataProvider ;
232
- spyDataProvider . resetHistory ( ) ;
233
- setInputValue ( comboBox , 'item 1' ) ;
234
- expect ( spyDataProvider . called ) . to . be . true ;
235
- const params = spyDataProvider . lastCall . args [ 0 ] ;
236
- expect ( params . filter ) . to . equal ( 'item 1' ) ;
237
- } ) ;
238
-
239
- it ( 'should clear filter on value change' , ( ) => {
240
- comboBox . dataProvider = spyDataProvider ;
241
- setInputValue ( comboBox , 'item 1' ) ;
242
- spyDataProvider . resetHistory ( ) ;
243
- comboBox . value = 'foo' ;
244
- const params = spyDataProvider . lastCall . args [ 0 ] ;
245
- expect ( params . filter ) . to . equal ( '' ) ;
246
- } ) ;
247
-
248
- it ( 'should clear filter on value clear' , ( ) => {
249
- comboBox . dataProvider = dataProvider ;
250
- setInputValue ( comboBox , 'item 1' ) ;
251
- comboBox . value = 'item 1' ;
252
- comboBox . value = '' ;
253
- expect ( comboBox . filter ) . to . equal ( '' ) ;
254
- } ) ;
255
-
256
- it ( 'should clear filter on opened change' , ( ) => {
257
- comboBox . dataProvider = dataProvider ;
258
- setInputValue ( comboBox , 'item 1' ) ;
259
- comboBox . opened = false ;
260
- expect ( comboBox . filter ) . to . equal ( '' ) ;
261
- } ) ;
262
-
263
224
it ( 'should not request on value change' , ( ) => {
264
225
comboBox . dataProvider = spyDataProvider ;
265
226
spyDataProvider . resetHistory ( ) ;
@@ -286,16 +247,6 @@ const TEMPLATES = {
286
247
} ;
287
248
} ) ;
288
249
289
- it ( 'should request page after partial filter & cancel & reopen' , ( ) => {
290
- comboBox . dataProvider = spyDataProvider ;
291
- setInputValue ( comboBox , 'it' ) ;
292
- spyDataProvider . resetHistory ( ) ;
293
- comboBox . cancel ( ) ;
294
- comboBox . opened = true ;
295
- const params = spyDataProvider . lastCall . args [ 0 ] ;
296
- expect ( params . filter ) . to . equal ( '' ) ;
297
- } ) ;
298
-
299
250
it ( 'should not request loaded page again' , ( ) => {
300
251
comboBox . dataProvider = spyDataProvider ;
301
252
comboBox . open ( ) ;
@@ -413,15 +364,6 @@ const TEMPLATES = {
413
364
expect ( spyAsyncDataProvider . calledOnce ) . to . be . true ;
414
365
} ) ;
415
366
416
- it ( 'should be invoked with correct filter parameter' , async ( ) => {
417
- comboBox . dataProvider = spyAsyncDataProvider ;
418
- setInputValue ( comboBox , '1' ) ;
419
- // Wait for the async data provider to respond
420
- await aTimeout ( 0 ) ;
421
- expect ( spyAsyncDataProvider . calledOnce ) . to . be . true ;
422
- expect ( spyAsyncDataProvider . firstCall . args [ 0 ] . filter ) . to . equal ( '1' ) ;
423
- } ) ;
424
-
425
367
it ( 'should be invoked on open with pre-defined size' , ( ) => {
426
368
comboBox . size = SIZE ;
427
369
comboBox . dataProvider = spyAsyncDataProvider ;
@@ -1176,45 +1118,5 @@ const TEMPLATES = {
1176
1118
expect ( comboBox . value ) . to . equal ( 'other value' ) ;
1177
1119
} ) ;
1178
1120
} ) ;
1179
-
1180
- describe ( 'dropdown behaviour when filtering' , ( ) => {
1181
- let openedSpy ;
1182
-
1183
- beforeEach ( ( ) => {
1184
- comboBox . dataProvider = spyDataProvider ;
1185
- comboBox . opened = true ;
1186
- spyDataProvider . resetHistory ( ) ;
1187
-
1188
- openedSpy = sinon . spy ( ) ;
1189
- comboBox . addEventListener ( 'vaadin-combo-box-dropdown-opened' , openedSpy ) ;
1190
- } ) ;
1191
-
1192
- it ( 'should not toggle between opened and closed when filtering' , ( ) => {
1193
- // Filter for something that should return results
1194
- comboBox . filter = 'item' ;
1195
- // Verify data provider has been called
1196
- expect ( spyDataProvider . calledOnce ) . to . be . true ;
1197
- // Dropdown should not have been closed and re-opened
1198
- expect ( openedSpy . called ) . to . be . false ;
1199
- } ) ;
1200
-
1201
- it ( 'should not toggle between opened and closed when setting a value' , ( ) => {
1202
- // Filter for something that should return results
1203
- comboBox . filter = 'item' ;
1204
- // Set a value
1205
- comboBox . value = 'item 1' ;
1206
- // Dropdown should not have been closed and re-opened
1207
- expect ( openedSpy . called ) . to . be . false ;
1208
- } ) ;
1209
-
1210
- it ( 'should close when there are no items' , ( ) => {
1211
- // Filter for something that doesn't exist
1212
- comboBox . filter = 'doesnotexist' ;
1213
- // Verify data provider has been called
1214
- expect ( spyDataProvider . calledOnce ) . to . be . true ;
1215
- // Dropdown should close
1216
- expect ( comboBox . $ . overlay . opened ) . to . be . false ;
1217
- } ) ;
1218
- } ) ;
1219
1121
} ) ;
1220
1122
} ) ;
0 commit comments