@@ -168,7 +168,6 @@ describe('ui-select tests', function() {
168168 if ( attrs . refresh !== undefined ) { choicesAttrsHtml += ' refresh="' + attrs . refresh + '"' ; }
169169 if ( attrs . refreshDelay !== undefined ) { choicesAttrsHtml += ' refresh-delay="' + attrs . refreshDelay + '"' ; }
170170 if ( attrs . backspaceReset !== undefined ) { attrsHtml += ' backspace-reset="' + attrs . backspaceReset + '"' ; }
171- if ( attrs . refreshOnActive !== undefined ) { choicesAttrsHtml += ' refresh-on-active="' + attrs . refreshOnActive + '"' ; }
172171
173172 }
174173
@@ -3123,14 +3122,25 @@ describe('ui-select tests', function() {
31233122 } ) ;
31243123
31253124 describe ( 'With refresh on active' , function ( ) {
3126- it ( 'should not refresh untill is activated' , function ( ) {
3125+ it ( 'should refresh when is activated' , function ( ) {
31273126 scope . fetchFromServer = function ( ) { } ;
3128- var el = createUiSelect ( { refresh :"fetchFromServer($select.search)" , refreshOnActive :true , refreshDelay :0 } ) ;
3129- spyOn ( scope , 'fetchFromServer' ) ;
3130- $timeout . flush ( ) ;
3131- expect ( scope . fetchFromServer . calls . any ( ) ) . toEqual ( false ) ;
3127+ var el = createUiSelect ( { refresh :"fetchFromServer($select.search)" , refreshDelay :0 } ) ;
3128+ spyOn ( scope , 'fetchFromServer' ) ;
3129+ expect ( el . scope ( ) . $select . open ) . toEqual ( false ) ;
31323130 el . scope ( ) . $select . activate ( ) ;
31333131 $timeout . flush ( ) ;
3132+ expect ( el . scope ( ) . $select . open ) . toEqual ( true ) ;
3133+ expect ( scope . fetchFromServer . calls . any ( ) ) . toEqual ( true ) ;
3134+ } ) ;
3135+
3136+ it ( 'should refresh when open is set to true' , function ( ) {
3137+ scope . fetchFromServer = function ( ) { } ;
3138+ var el = createUiSelect ( { refresh :"fetchFromServer($select.search)" , refreshDelay :0 } ) ;
3139+ spyOn ( scope , 'fetchFromServer' ) ;
3140+ expect ( el . scope ( ) . $select . open ) . toEqual ( false ) ;
3141+ openDropdown ( el ) ;
3142+ $timeout . flush ( ) ;
3143+ expect ( el . scope ( ) . $select . open ) . toEqual ( true ) ;
31343144 expect ( scope . fetchFromServer . calls . any ( ) ) . toEqual ( true ) ;
31353145 } ) ;
31363146 } ) ;
0 commit comments