@@ -165,6 +165,9 @@ describe('ui-select tests', function () {
165
165
if ( attrs . tagging !== undefined ) {
166
166
attrsHtml += ' tagging="' + attrs . tagging + '"' ;
167
167
}
168
+ if ( attrs . taggingLabel !== undefined ) {
169
+ attrsHtml += ' tagging-label="' + attrs . taggingLabel + '"' ;
170
+ }
168
171
if ( attrs . taggingTokens !== undefined ) {
169
172
attrsHtml += ' tagging-tokens="' + attrs . taggingTokens + '"' ;
170
173
}
@@ -700,6 +703,15 @@ describe('ui-select tests', function () {
700
703
expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( "I don't exist" ) ;
701
704
} ) ;
702
705
706
+ it ( 'should not include tagging label if the selection is clicked' , function ( ) {
707
+ var el = createUiSelect ( { tagging : true , taggingLabel : ' (default)' } ) ;
708
+ clickMatch ( el ) ;
709
+
710
+ $ ( el ) . scope ( ) . $select . select ( "I don't exist (default)" , undefined , { type : 'click' } ) ;
711
+
712
+ expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( "I don't exist" ) ;
713
+ } ) ;
714
+
703
715
it ( 'should format new items using the tagging function when the attribute is a function' , function ( ) {
704
716
scope . taggingFunc = function ( name ) {
705
717
return {
@@ -2712,6 +2724,17 @@ describe('ui-select tests', function () {
2712
2724
. toEqual ( jasmine . objectContaining ( { name :
'Amalie' , email :
'[email protected] ' } ) ) ;
2713
2725
} ) ;
2714
2726
2727
+ it ( 'should not include tagging label if the selection is clicked' , function ( ) {
2728
+ var el = createUiSelectMultiple ( { tagging : true , taggingLabel : ' (default)' } ) ;
2729
+ clickMatch ( el ) ;
2730
+
2731
+ $ ( el ) . scope ( ) . $select . select ( "I don't exist (default)" , undefined , { type : 'click' } ) ;
2732
+ $ ( el ) . scope ( ) . $select . select ( "I also don't exist (default)" , undefined , { type : 'click' } ) ;
2733
+
2734
+ expect ( $ ( el ) . scope ( ) . $select . selected [ 0 ] ) . toEqual ( "I don't exist" ) ;
2735
+ expect ( $ ( el ) . scope ( ) . $select . selected [ 1 ] ) . toEqual ( "I also don't exist" ) ;
2736
+ } ) ;
2737
+
2715
2738
2716
2739
it ( 'should have tolerance for undefined values' , function ( ) {
2717
2740
0 commit comments