Skip to content

Commit 5b3bf5c

Browse files
committed
Remove tagging tests
1 parent a717820 commit 5b3bf5c

File tree

1 file changed

+0
-186
lines changed

1 file changed

+0
-186
lines changed

test/select.spec.js

Lines changed: 0 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -381,55 +381,6 @@ describe('ui-select tests', function() {
381381
expect(isDropdownOpened(el3)).toEqual(true);
382382
});
383383

384-
it('should allow decline tags when tagging function returns null', function() {
385-
scope.taggingFunc = function (name) {
386-
return null;
387-
};
388-
389-
var el = createUiSelect({tagging: 'taggingFunc'});
390-
clickMatch(el);
391-
392-
$(el).scope().$select.search = 'idontexist';
393-
$(el).scope().$select.activeIndex = 0;
394-
$(el).scope().$select.select('idontexist');
395-
396-
expect($(el).scope().$select.selected).not.toBeDefined();
397-
});
398-
399-
it('should allow tagging if the attribute says so', function() {
400-
var el = createUiSelect({tagging: true});
401-
clickMatch(el);
402-
403-
$(el).scope().$select.select("I don't exist");
404-
405-
expect($(el).scope().$select.selected).toEqual("I don't exist");
406-
});
407-
408-
it('should format new items using the tagging function when the attribute is a function', function() {
409-
scope.taggingFunc = function (name) {
410-
return {
411-
name: name,
412-
email: name + '@email.com',
413-
group: 'Foo',
414-
age: 12
415-
};
416-
};
417-
418-
var el = createUiSelect({tagging: 'taggingFunc'});
419-
clickMatch(el);
420-
421-
$(el).scope().$select.search = 'idontexist';
422-
$(el).scope().$select.activeIndex = 0;
423-
$(el).scope().$select.select('idontexist');
424-
425-
expect($(el).scope().$select.selected).toEqual({
426-
name: 'idontexist',
427-
428-
group: 'Foo',
429-
age: 12
430-
});
431-
});
432-
433384
// See when an item that evaluates to false (such as "false" or "no") is selected, the placeholder is shown https://github.com/angular-ui/ui-select/pull/32
434385
it('should not display the placeholder when item evaluates to false', function() {
435386
scope.items = ['false'];
@@ -1262,58 +1213,6 @@ describe('ui-select tests', function() {
12621213
expect(scope.$model).toBe(scope.$item);
12631214
});
12641215

1265-
it('should allow creating tag in single select mode with tagging enabled', function() {
1266-
1267-
scope.taggingFunc = function (name) {
1268-
return name;
1269-
};
1270-
1271-
var el = compileTemplate(
1272-
'<ui-select ng-model="selection.selected" tagging="taggingFunc" tagging-label="false"> \
1273-
<ui-select-match placeholder="Pick one...">{{$select.selected.name}}</ui-select-match> \
1274-
<ui-select-choices repeat="person in people | filter: $select.search"> \
1275-
<div ng-bind-html="person.name" | highlight: $select.search"></div> \
1276-
<div ng-bind-html="person.email | highlight: $select.search"></div> \
1277-
</ui-select-choices> \
1278-
</ui-select>'
1279-
);
1280-
1281-
clickMatch(el);
1282-
1283-
var searchInput = el.find('.ui-select-search');
1284-
1285-
setSearchText(el, 'idontexist');
1286-
1287-
triggerKeydown(searchInput, Key.Enter);
1288-
1289-
expect($(el).scope().$select.selected).toEqual('idontexist');
1290-
});
1291-
1292-
it('should allow creating tag on ENTER in multiple select mode with tagging enabled, no labels', function() {
1293-
1294-
scope.taggingFunc = function (name) {
1295-
return name;
1296-
};
1297-
1298-
var el = compileTemplate(
1299-
'<ui-select multiple ng-model="selection.selected" tagging="taggingFunc" tagging-label="false"> \
1300-
<ui-select-match placeholder="Pick one...">{{$select.selected.name}}</ui-select-match> \
1301-
<ui-select-choices repeat="person in people | filter: $select.search"> \
1302-
<div ng-bind-html="person.name" | highlight: $select.search"></div> \
1303-
<div ng-bind-html="person.email | highlight: $select.search"></div> \
1304-
</ui-select-choices> \
1305-
</ui-select>'
1306-
);
1307-
1308-
var searchInput = el.find('.ui-select-search');
1309-
1310-
setSearchText(el, 'idontexist');
1311-
1312-
triggerKeydown(searchInput, Key.Enter);
1313-
1314-
expect($(el).scope().$select.selected).toEqual(['idontexist']);
1315-
});
1316-
13171216
it('should append/transclude content (with correct scope) that users add at <match> tag', function () {
13181217

13191218
var el = compileTemplate(
@@ -1357,62 +1256,6 @@ describe('ui-select tests', function() {
13571256

13581257
});
13591258

1360-
it('should call refresh function when search text changes', function () {
1361-
1362-
var el = compileTemplate(
1363-
'<ui-select ng-model="selection.selected"> \
1364-
<ui-select-match> \
1365-
</ui-select-match> \
1366-
<ui-select-choices repeat="person in people | filter: $select.search" \
1367-
refresh="fetchFromServer($select.search)" refresh-delay="0"> \
1368-
<div ng-bind-html="person.name | highlight: $select.search"></div> \
1369-
<div ng-if="person.name==\'Wladimir\'"> \
1370-
<span class="only-once">I should appear only once</span>\
1371-
</div> \
1372-
</ui-select-choices> \
1373-
</ui-select>'
1374-
);
1375-
1376-
scope.fetchFromServer = function(){};
1377-
1378-
spyOn(scope, 'fetchFromServer');
1379-
1380-
el.scope().$select.search = 'r';
1381-
scope.$digest();
1382-
$timeout.flush();
1383-
1384-
expect(scope.fetchFromServer).toHaveBeenCalledWith('r');
1385-
1386-
});
1387-
1388-
it('should call refresh function when search text changes', function () {
1389-
1390-
var el = compileTemplate(
1391-
'<ui-select ng-model="selection.selected"> \
1392-
<ui-select-match> \
1393-
</ui-select-match> \
1394-
<ui-select-choices repeat="person in people | filter: $select.search" \
1395-
refresh="fetchFromServer($select.search)" refresh-delay="0"> \
1396-
<div ng-bind-html="person.name | highlight: $select.search"></div> \
1397-
<div ng-if="person.name==\'Wladimir\'"> \
1398-
<span class="only-once">I should appear only once</span>\
1399-
</div> \
1400-
</ui-select-choices> \
1401-
</ui-select>'
1402-
);
1403-
1404-
scope.fetchFromServer = function(){};
1405-
1406-
spyOn(scope, 'fetchFromServer');
1407-
1408-
el.scope().$select.search = 'r';
1409-
scope.$digest();
1410-
$timeout.flush();
1411-
1412-
expect(scope.fetchFromServer).toHaveBeenCalledWith('r');
1413-
1414-
});
1415-
14161259
it('should format view value correctly when using single property binding and refresh function', function () {
14171260

14181261
var el = compileTemplate(
@@ -2253,33 +2096,4 @@ describe('ui-select tests', function() {
22532096
expect(el.css('width')).toBe(originalWidth);
22542097
});
22552098
});
2256-
2257-
describe('with refresh on active', function(){
2258-
it('should not refresh untill is activate', function(){
2259-
2260-
var el = compileTemplate(
2261-
'<ui-select ng-model="selection.selected"> \
2262-
<ui-select-match> \
2263-
</ui-select-match> \
2264-
<ui-select-choices repeat="person in people | filter: $select.search" \
2265-
refresh="fetchFromServer($select.search)" refresh-on-active="true" refresh-delay="0"> \
2266-
<div ng-bind-html="person.name | highlight: $select.search"></div> \
2267-
<div ng-if="person.name==\'Wladimir\'"> \
2268-
<span class="only-once">I should appear only once</span>\
2269-
</div> \
2270-
</ui-select-choices> \
2271-
</ui-select>'
2272-
);
2273-
2274-
scope.fetchFromServer = function(){};
2275-
spyOn(scope, 'fetchFromServer');
2276-
$timeout.flush();
2277-
expect(scope.fetchFromServer.calls.any()).toEqual(false);
2278-
2279-
el.scope().$select.activate();
2280-
$timeout.flush();
2281-
expect(scope.fetchFromServer.calls.any()).toEqual(true);
2282-
});
2283-
2284-
});
22852099
});

0 commit comments

Comments
 (0)