This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1025,6 +1025,32 @@ describe('ui-select tests', function() {
1025
1025
expect ( scope . $model ) . toBe ( scope . $item ) ;
1026
1026
} ) ;
1027
1027
1028
+ it ( 'should allow creating tag in single select mode with tagging enabled' , function ( ) {
1029
+
1030
+ scope . taggingFunc = function ( name ) {
1031
+ return name ;
1032
+ } ;
1033
+
1034
+ var el = compileTemplate (
1035
+ '<ui-select ng-model="selection.selected" tagging="taggingFunc" tagging-label="false"> \
1036
+ <ui-select-match placeholder="Pick one...">{{$select.selected.name}}</ui-select-match> \
1037
+ <ui-select-choices repeat="person in people | filter: $select.search"> \
1038
+ <div ng-bind-html="person.name" | highlight: $select.search"></div> \
1039
+ <div ng-bind-html="person.email | highlight: $select.search"></div> \
1040
+ </ui-select-choices> \
1041
+ </ui-select>'
1042
+ ) ;
1043
+ clickMatch ( el ) ;
1044
+
1045
+ var searchInput = el . find ( '.ui-select-search' ) ;
1046
+
1047
+ el . scope ( ) . $select . search = 'idontexist' ;
1048
+
1049
+ triggerKeydown ( searchInput , Key . Enter ) ;
1050
+
1051
+ expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( 'idontexist' ) ;
1052
+ } ) ;
1053
+
1028
1054
it ( 'should append/transclude content (with correct scope) that users add at <match> tag' , function ( ) {
1029
1055
1030
1056
var el = compileTemplate (
You can’t perform that action at this time.
0 commit comments