Skip to content

Commit 6a70e0e

Browse files
fix(orderBy): ensure correct ordering with arrays of objects and no predicate
Closes angular#11866
1 parent c1c975b commit 6a70e0e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/ng/filter/orderBySpec.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ describe('Filter: orderBy', function() {
1111
it('should return sorted array if predicate is not provided', function() {
1212
expect(orderBy([2, 1, 3])).toEqual([1, 2, 3]);
1313

14-
// expect(orderBy([2, 1, 3], '')).toEqual([1, 2, 3]);
15-
// expect(orderBy([2, 1, 3], [])).toEqual([1, 2, 3]);
16-
// expect(orderBy([2, 1, 3], [''])).toEqual([1, 2, 3]);
14+
expect(orderBy([2, 1, 3], '')).toEqual([1, 2, 3]);
15+
expect(orderBy([2, 1, 3], [])).toEqual([1, 2, 3]);
16+
expect(orderBy([2, 1, 3], [''])).toEqual([1, 2, 3]);
1717

18-
// expect(orderBy([2, 1, 3], '+')).toEqual([1, 2, 3]);
19-
// expect(orderBy([2, 1, 3], ['+'])).toEqual([1, 2, 3]);
18+
expect(orderBy([2, 1, 3], '+')).toEqual([1, 2, 3]);
19+
expect(orderBy([2, 1, 3], ['+'])).toEqual([1, 2, 3]);
2020

21-
// expect(orderBy([2, 1, 3], '-')).toEqual([3, 2, 1]);
22-
// expect(orderBy([2, 1, 3], ['-'])).toEqual([3, 2, 1]);
21+
expect(orderBy([2, 1, 3], '-')).toEqual([3, 2, 1]);
22+
expect(orderBy([2, 1, 3], ['-'])).toEqual([3, 2, 1]);
2323
});
2424

2525

@@ -220,7 +220,6 @@ describe('Filter: orderBy', function() {
220220
});
221221

222222

223-
///XXXXX
224223
it('should sort array by date predicate', function() {
225224
// same dates
226225
expect(orderBy([

0 commit comments

Comments
 (0)