Skip to content

Commit c435bc6

Browse files
committed
style(test/filter-by): rm unnecessary newlines
1 parent 7b97a49 commit c435bc6

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

test/spec/filter/collection/filter-by.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
'use strict';
22

33
describe('filterByFilter', function() {
4-
54
var filter;
65

76
beforeEach(module('a8m.filter-by'));
8-
97
beforeEach(inject(function($filter) {
108
filter = $filter('filterBy');
119
}));
1210

1311
it('should filter by specific properties and avoid the rest', function() {
14-
1512
var users = [
1613
{ id: 1, user: { first_name: 'foo', last_name: 'bar', mobile: 4444 } },
1714
{ id: 2, user: { first_name: 'bar', last_name: 'foo', mobile: 3333 } },
@@ -26,11 +23,9 @@ describe('filterByFilter', function() {
2623
expect(filter(users, ['id', 'user.mobile'], '1')).toEqual([users[0], users[3]]);
2724
expect(filter(users, ['id'], '1')).toEqual([users[0]]);
2825
expect(filter(users, ['id', 'user.mobile'], '11')).toEqual([users[3]]);
29-
3026
});
3127

3228
it('should support to get object as collection', function() {
33-
3429
var users = {
3530
0: { id: 1, user: { first_name: 'foo', last_name: 'bar', mobile: 4444 } },
3631
1: { id: 2, user: { first_name: 'bar', last_name: 'foo', mobile: 3333 } },
@@ -41,11 +36,9 @@ describe('filterByFilter', function() {
4136
expect(filter(users, ['user.first_name', 'user.last_name'], 'foo')).toEqual(users);
4237
expect(filter(users, ['user.first_name'], 'oo')).toEqual([users[0], users[2]]);
4338
expect(filter(users, ['user.last_name'], 'bar')).toEqual([users[0]]);
44-
4539
});
4640

4741
it('should parse concatenate properties, and search them by one field', function() {
48-
4942
var users = [
5043
{ id: 1, user: { first_name: 'foo', last_name: 'bar', mobile: 4444 } },
5144
{ id: 2, user: { first_name: 'bar', last_name: 'foo', mobile: 3333 } },
@@ -62,11 +55,9 @@ describe('filterByFilter', function() {
6255
expect(filter(users, ['user.first_name + user.last_name'], 'a')).toEqual(users);
6356
expect(filter(users, ['user.first_name + user.last_name'], 'ba')).toEqual(users);
6457
expect(filter(users, ['user.first_name + user.last_name'], 'foo')).toEqual(users);
65-
6658
});
6759

6860
it('should take care on extreme conditions', function() {
69-
7061
var users = [
7162
{ id: 1, user: { first_name: 'foo', last_name: 'bar', mobile: 4444 } },
7263
{ id: 2, user: { first_name: 'bar', last_name: 'foo', mobile: 3333 } },
@@ -80,16 +71,13 @@ describe('filterByFilter', function() {
8071
expect(filter(users, ['id', 'phone'], null)).toEqual(users);
8172
expect(filter(users, null, null)).toEqual(users);
8273
expect(filter(users, [], [])).toEqual(users);
83-
8474
});
8575

8676
it('should get a !collection and return it as-is', function() {
87-
8877
expect(filter(!1)).toBeFalsy();
8978
expect(filter(1)).toEqual(1);
9079
expect(filter('string')).toEqual('string');
9180
expect(filter(undefined)).toEqual(undefined);
92-
9381
});
9482

9583
it('should not coerce non-string/number properties', function() {
@@ -101,32 +89,23 @@ describe('filterByFilter', function() {
10189
});
10290

10391
describe('strict mode', function() {
104-
10592
var users = [
10693
{ id: 1, user: { first_name: 'foo', last_name: 'bar', mobile: 4444 } }
10794
];
10895

10996
it('should only return exact matches', function() {
110-
11197
expect(filter(users, ['user.first_name'], 'fo', true)).toEqual([]);
11298
expect(filter(users, ['user.first_name'], 'foo', true)).toEqual(users);
113-
11499
});
115100

116101
it('should handle multiple properties', function() {
117-
118102
expect(filter(users, ['user.first_name', 'user.last_name'], 'ba', true)).toEqual([]);
119103
expect(filter(users, ['user.first_name', 'user.last_name'], 'bar', true)).toEqual(users);
120-
121104
});
122105

123106
it('should handle concatenation', function() {
124-
125107
expect(filter(users, ['user.first_name + user.last_name'], 'foo ba', true)).toEqual([]);
126108
expect(filter(users, ['user.first_name + user.last_name'], 'foo bar', true)).toEqual(users);
127-
128109
});
129-
130110
});
131-
132111
});

0 commit comments

Comments
 (0)