Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit ecb4b46

Browse files
author
vyarovuy
committed
- fix removing test
1 parent dfbe666 commit ecb4b46

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

test/select.spec.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ describe('ui-select tests', function() {
6060
return person.age % 2 ? 'even' : 'odd';
6161
};
6262

63-
6463
scope.filterInvertOrder = function(groups) {
6564
debugger;
6665
var results = groups.sort(function(groupA, groupB){
@@ -69,12 +68,6 @@ describe('ui-select tests', function() {
6968
return results;
7069
};
7170

72-
scope.filterBarAndBaz = function(groups) {
73-
debugger;
74-
return groups.sort(function(groupA, groupB){
75-
return groupA.name.toLocaleLowerCase() < groupB.name.toLocaleLowerCase();
76-
});
77-
};
7871

7972
scope.people = [
8073
{ name: 'Adam', email: 'adam@email.com', group: 'Foo', age: 12 },
@@ -699,6 +692,25 @@ describe('ui-select tests', function() {
699692
});
700693
});
701694

695+
describe('choices group by function', function() {
696+
function createUiSelect() {
697+
return compileTemplate(
698+
'<ui-select ng-model="selection.selected"> \
699+
<ui-select-match placeholder="Pick one...">{{$select.selected.name}}</ui-select-match> \
700+
<ui-select-choices group-by="getGroupLabel" repeat="person in people | filter: $select.search"> \
701+
<div ng-bind-html="person.name | highlight: $select.search"></div> \
702+
</ui-select-choices> \
703+
</ui-select>'
704+
);
705+
}
706+
it("should extract group value through function", function () {
707+
var el = createUiSelect();
708+
expect(el.find('.ui-select-choices-group .ui-select-choices-group-label').map(function() {
709+
return this.textContent;
710+
}).toArray()).toEqual(['odd', 'even']);
711+
});
712+
});
713+
702714
describe('choices group filter function', function() {
703715
function createUiSelect() {
704716
return compileTemplate('\

0 commit comments

Comments
 (0)