@@ -161,6 +161,7 @@ describe('ui-select tests', function () {
161
161
if ( attrs . theme !== undefined ) { attrsHtml += ' theme="' + attrs . theme + '"' ; }
162
162
if ( attrs . tabindex !== undefined ) { attrsHtml += ' tabindex="' + attrs . tabindex + '"' ; }
163
163
if ( attrs . tagging !== undefined ) { attrsHtml += ' tagging="' + attrs . tagging + '"' ; }
164
+ if ( attrs . taggingLabel !== undefined ) { attrsHtml += ' tagging-label="' + attrs . taggingLabel + '"' ; }
164
165
if ( attrs . taggingTokens !== undefined ) { attrsHtml += ' tagging-tokens="' + attrs . taggingTokens + '"' ; }
165
166
if ( attrs . title !== undefined ) { attrsHtml += ' title="' + attrs . title + '"' ; }
166
167
if ( attrs . appendToBody !== undefined ) { attrsHtml += ' append-to-body="' + attrs . appendToBody + '"' ; }
@@ -682,6 +683,15 @@ describe('ui-select tests', function () {
682
683
expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( "I don't exist" ) ;
683
684
} ) ;
684
685
686
+ it ( 'should not include tagging label if the selection is clicked' , function ( ) {
687
+ var el = createUiSelect ( { tagging : true , taggingLabel : ' (default)' } ) ;
688
+ clickMatch ( el ) ;
689
+
690
+ $ ( el ) . scope ( ) . $select . select ( "I don't exist (default)" , undefined , { type : 'click' } ) ;
691
+
692
+ expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( "I don't exist" ) ;
693
+ } ) ;
694
+
685
695
it ( 'should format new items using the tagging function when the attribute is a function' , function ( ) {
686
696
scope . taggingFunc = function ( name ) {
687
697
return {
@@ -2730,6 +2740,17 @@ describe('ui-select tests', function () {
2730
2740
expect ( el . scope ( ) . $select . items [ 1 ] ) . toEqual ( jasmine . objectContaining ( { name :
'Amalie' , email :
'[email protected] ' } ) ) ;
2731
2741
} ) ;
2732
2742
2743
+ it ( 'should not include tagging label if the selection is clicked' , function ( ) {
2744
+ var el = createUiSelectMultiple ( { tagging : true , taggingLabel : ' (default)' } ) ;
2745
+ clickMatch ( el ) ;
2746
+
2747
+ $ ( el ) . scope ( ) . $select . select ( "I don't exist (default)" , undefined , { type : 'click' } ) ;
2748
+ $ ( el ) . scope ( ) . $select . select ( "I also don't exist (default)" , undefined , { type : 'click' } ) ;
2749
+
2750
+ expect ( $ ( el ) . scope ( ) . $select . selected [ 0 ] ) . toEqual ( "I don't exist" ) ;
2751
+ expect ( $ ( el ) . scope ( ) . $select . selected [ 1 ] ) . toEqual ( "I also don't exist" ) ;
2752
+ } ) ;
2753
+
2733
2754
2734
2755
it ( 'should have tolerance for undefined values' , function ( ) {
2735
2756
0 commit comments