This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree 1 file changed +27
-1
lines changed 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1040,17 +1040,43 @@ describe('ui-select tests', function() {
1040
1040
</ui-select-choices> \
1041
1041
</ui-select>'
1042
1042
) ;
1043
+
1043
1044
clickMatch ( el ) ;
1044
1045
1045
1046
var searchInput = el . find ( '.ui-select-search' ) ;
1046
1047
1047
- el . scope ( ) . $select . search = 'idontexist' ;
1048
+ setSearchText ( el , 'idontexist' ) ;
1048
1049
1049
1050
triggerKeydown ( searchInput , Key . Enter ) ;
1050
1051
1051
1052
expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( 'idontexist' ) ;
1052
1053
} ) ;
1053
1054
1055
+ it ( 'should allow creating tag on ENTER in multiple select mode with tagging enabled, no labels' , function ( ) {
1056
+
1057
+ scope . taggingFunc = function ( name ) {
1058
+ return name ;
1059
+ } ;
1060
+
1061
+ var el = compileTemplate (
1062
+ '<ui-select multiple ng-model="selection.selected" tagging="taggingFunc" tagging-label="false"> \
1063
+ <ui-select-match placeholder="Pick one...">{{$select.selected.name}}</ui-select-match> \
1064
+ <ui-select-choices repeat="person in people | filter: $select.search"> \
1065
+ <div ng-bind-html="person.name" | highlight: $select.search"></div> \
1066
+ <div ng-bind-html="person.email | highlight: $select.search"></div> \
1067
+ </ui-select-choices> \
1068
+ </ui-select>'
1069
+ ) ;
1070
+
1071
+ var searchInput = el . find ( '.ui-select-search' ) ;
1072
+
1073
+ setSearchText ( el , 'idontexist' ) ;
1074
+
1075
+ triggerKeydown ( searchInput , Key . Enter ) ;
1076
+
1077
+ expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( [ 'idontexist' ] ) ;
1078
+ } ) ;
1079
+
1054
1080
it ( 'should append/transclude content (with correct scope) that users add at <match> tag' , function ( ) {
1055
1081
1056
1082
var el = compileTemplate (
You can’t perform that action at this time.
0 commit comments