@@ -1921,13 +1921,12 @@ describe('ui-select tests', function () {
19211921 if ( attrs . removeSelected !== undefined ) { attrsHtml += ' remove-selected="' + attrs . removeSelected + '"' ; }
19221922 if ( attrs . spinnerEnabled !== undefined ) { attrsHtml += ' spinner-enabled="' + attrs . spinnerEnabled + '"' ; }
19231923 if ( attrs . spinnerClass !== undefined ) { attrsHtml += ' spinner-class="' + attrs . spinnerClass + '"' ; }
1924-
19251924 if ( attrs . groupBy !== undefined ) { choicesAttrsHtml += ' group-by="' + attrs . groupBy + '"' ; }
19261925 if ( attrs . uiDisableChoice !== undefined ) { choicesAttrsHtml += ' ui-disable-choice="' + attrs . uiDisableChoice + '"' ; }
19271926 if ( attrs . refresh !== undefined ) { choicesAttrsHtml += ' refresh="' + attrs . refresh + '"' ; }
19281927 if ( attrs . refreshDelay !== undefined ) { choicesAttrsHtml += ' refresh-delay="' + attrs . refreshDelay + '"' ; }
1929-
19301928 if ( attrs . lockChoice !== undefined ) { matchesAttrsHtml += ' ui-lock-choice="' + attrs . lockChoice + '"' ; }
1929+ if ( attrs . uiSelectHeaderGroupSelectable !== undefined ) { choicesAttrsHtml += ' ui-select-header-group-selectable="' + attrs . uiSelectHeaderGroupSelectable + '"' ; }
19311930 }
19321931
19331932 matchesAttrsHtml += ' placeholder="' + matchesPlaceholder + '"' ;
@@ -2084,6 +2083,7 @@ describe('ui-select tests', function () {
20842083 expect ( containerWidth - newWidth ) . toBeLessThan ( 10 ) ;
20852084
20862085 } ) ;
2086+
20872087 it ( 'should move to last match when pressing BACKSPACE key from search' , function ( ) {
20882088
20892089 var el = createUiSelectMultiple ( ) ;
@@ -2158,7 +2158,6 @@ describe('ui-select tests', function () {
21582158
21592159 } ) ;
21602160
2161-
21622161 it ( 'should move to last match when pressing LEFT key from search' , function ( ) {
21632162
21642163 var el = createUiSelectMultiple ( ) ;
@@ -3161,6 +3160,37 @@ describe('ui-select tests', function () {
31613160 expect ( el . scope ( ) . $select . spinnerClass ) . toBe ( 'randomclass' ) ;
31623161 } ) ;
31633162 } ) ;
3163+
3164+ describe ( 'uiSelectHeaderGroupSelectable directive' , function ( ) {
3165+ it ( 'should have a default value of false' , function ( ) {
3166+ var el = createUiSelectMultiple ( { groupBy : "'age'" , uiSelectHeaderGroupSelectable : true } ) ;
3167+ var ctrl = el . scope ( ) . $select ;
3168+
3169+ showChoicesForSearch ( el , '' ) ;
3170+ expect ( ctrl . multiple ) . toEqual ( true ) ;
3171+ expect ( ctrl . groups . length ) . toEqual ( 5 ) ;
3172+ openDropdown ( el ) ;
3173+
3174+ $ ( el ) . find ( 'div.ui-select-header-group-selectable' ) . first ( ) . click ( ) ;
3175+ showChoicesForSearch ( el , '' ) ;
3176+ expect ( ctrl . selected . length ) . toEqual ( 2 ) ;
3177+ } ) ;
3178+
3179+ it ( 'should don\'t work with false attribute' , function ( ) {
3180+ var el = createUiSelectMultiple ( { groupBy : "'age'" , uiSelectHeaderGroupSelectable : false } ) ;
3181+ var ctrl = el . scope ( ) . $select ;
3182+
3183+ showChoicesForSearch ( el , '' ) ;
3184+ expect ( ctrl . multiple ) . toEqual ( true ) ;
3185+ expect ( ctrl . groups . length ) . toEqual ( 5 ) ;
3186+ openDropdown ( el ) ;
3187+
3188+ $ ( el ) . find ( 'div.ui-select-header-group-selectable' ) . first ( ) . click ( ) ;
3189+ showChoicesForSearch ( el , '' ) ;
3190+
3191+ expect ( ctrl . selected . length ) . toEqual ( 0 ) ;
3192+ } ) ;
3193+ } ) ;
31643194 } ) ;
31653195
31663196 it ( 'should add an id to the search input field' , function ( ) {
0 commit comments