@@ -85,6 +85,11 @@ describe('ui-select tests', function() {
85
85
}
86
86
87
87
function clickItem ( el , text ) {
88
+
89
+ if ( ! isDropdownOpened ( el ) ) {
90
+ openDropdown ( el ) ;
91
+ }
92
+
88
93
$ ( el ) . find ( '.ui-select-choices-row div:contains("' + text + '")' ) . click ( ) ;
89
94
scope . $digest ( ) ;
90
95
}
@@ -114,6 +119,13 @@ describe('ui-select tests', function() {
114
119
$timeout . flush ( ) ;
115
120
}
116
121
122
+ function openDropdown ( el ) {
123
+ var $select = el . scope ( ) . $select ;
124
+ $select . open = true ;
125
+ scope . $digest ( ) ;
126
+ } ;
127
+
128
+
117
129
// Tests
118
130
119
131
it ( 'should compile child directives' , function ( ) {
@@ -357,6 +369,8 @@ describe('ui-select tests', function() {
357
369
var option = $ ( this . el ) . find ( '.ui-select-choices-row div:contains("Wladimir")' ) ;
358
370
var container = option . closest ( '.ui-select-choices-row' ) ;
359
371
372
+ openDropdown ( this . el ) ;
373
+
360
374
expect ( container . hasClass ( 'disabled' ) ) . toBeTruthy ( ) ;
361
375
} ) ;
362
376
} ) ;
@@ -386,6 +400,8 @@ describe('ui-select tests', function() {
386
400
var option = $ ( this . el ) . find ( '.ui-select-choices-row div:contains("Wladimir")' ) ;
387
401
var container = option . closest ( '.ui-select-choices-row' ) ;
388
402
403
+ openDropdown ( this . el ) ;
404
+
389
405
expect ( container . hasClass ( 'disabled' ) ) . toBeTruthy ( ) ;
390
406
} ) ;
391
407
} ) ;
@@ -415,6 +431,8 @@ describe('ui-select tests', function() {
415
431
var option = $ ( this . el ) . find ( '.ui-select-choices-row div:contains("Wladimir")' ) ;
416
432
var container = option . closest ( '.ui-select-choices-row' ) ;
417
433
434
+ openDropdown ( this . el ) ;
435
+
418
436
expect ( container . hasClass ( 'disabled' ) ) . toBeTruthy ( ) ;
419
437
} ) ;
420
438
} ) ;
@@ -467,6 +485,9 @@ describe('ui-select tests', function() {
467
485
el . scope ( ) . $select . search = 't' ;
468
486
scope . $digest ( ) ;
469
487
var choices = el . find ( '.ui-select-choices-row' ) ;
488
+
489
+ openDropdown ( el ) ;
490
+
470
491
expect ( choices . eq ( 0 ) ) . toHaveClass ( 'active' ) ;
471
492
expect ( getGroupLabel ( choices . eq ( 0 ) ) . text ( ) ) . toBe ( 'Foo' ) ;
472
493
0 commit comments