@@ -85,6 +85,11 @@ describe('ui-select tests', function() {
8585 }
8686
8787 function clickItem ( el , text ) {
88+
89+ if ( ! isDropdownOpened ( el ) ) {
90+ openDropdown ( el ) ;
91+ }
92+
8893 $ ( el ) . find ( '.ui-select-choices-row div:contains("' + text + '")' ) . click ( ) ;
8994 scope . $digest ( ) ;
9095 }
@@ -114,6 +119,13 @@ describe('ui-select tests', function() {
114119 $timeout . flush ( ) ;
115120 }
116121
122+ function openDropdown ( el ) {
123+ var $select = el . scope ( ) . $select ;
124+ $select . open = true ;
125+ scope . $digest ( ) ;
126+ } ;
127+
128+
117129 // Tests
118130
119131 it ( 'should compile child directives' , function ( ) {
@@ -357,6 +369,8 @@ describe('ui-select tests', function() {
357369 var option = $ ( this . el ) . find ( '.ui-select-choices-row div:contains("Wladimir")' ) ;
358370 var container = option . closest ( '.ui-select-choices-row' ) ;
359371
372+ openDropdown ( this . el ) ;
373+
360374 expect ( container . hasClass ( 'disabled' ) ) . toBeTruthy ( ) ;
361375 } ) ;
362376 } ) ;
@@ -386,6 +400,8 @@ describe('ui-select tests', function() {
386400 var option = $ ( this . el ) . find ( '.ui-select-choices-row div:contains("Wladimir")' ) ;
387401 var container = option . closest ( '.ui-select-choices-row' ) ;
388402
403+ openDropdown ( this . el ) ;
404+
389405 expect ( container . hasClass ( 'disabled' ) ) . toBeTruthy ( ) ;
390406 } ) ;
391407 } ) ;
@@ -415,6 +431,8 @@ describe('ui-select tests', function() {
415431 var option = $ ( this . el ) . find ( '.ui-select-choices-row div:contains("Wladimir")' ) ;
416432 var container = option . closest ( '.ui-select-choices-row' ) ;
417433
434+ openDropdown ( this . el ) ;
435+
418436 expect ( container . hasClass ( 'disabled' ) ) . toBeTruthy ( ) ;
419437 } ) ;
420438 } ) ;
@@ -467,6 +485,9 @@ describe('ui-select tests', function() {
467485 el . scope ( ) . $select . search = 't' ;
468486 scope . $digest ( ) ;
469487 var choices = el . find ( '.ui-select-choices-row' ) ;
488+
489+ openDropdown ( el ) ;
490+
470491 expect ( choices . eq ( 0 ) ) . toHaveClass ( 'active' ) ;
471492 expect ( getGroupLabel ( choices . eq ( 0 ) ) . text ( ) ) . toBe ( 'Foo' ) ;
472493
0 commit comments