Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 7574dd2

Browse files
gkalpakcaitp
authored andcommitted
style(filterSpec): fix white-space and newline inconsistencies
Closes #9765
1 parent 3b3d921 commit 7574dd2

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

Diff for: test/ng/filter/filterSpec.js

+16-11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ describe('Filter: filter', function() {
77
filter = $filter('filter');
88
}));
99

10+
1011
it('should filter by string', function() {
1112
var items = ['MIsKO', {name: 'shyam'}, ['adam'], 1234];
1213
expect(filter(items, '').length).toBe(4);
@@ -27,13 +28,15 @@ describe('Filter: filter', function() {
2728
expect(filter(items, "I don't exist").length).toBe(0);
2829
});
2930

31+
3032
it('should not read $ properties', function() {
3133
expect(''.charAt(0)).toBe(''); // assumption
3234

3335
var items = [{$name: 'misko'}];
3436
expect(filter(items, 'misko').length).toBe(0);
3537
});
3638

39+
3740
it('should filter on specific property', function() {
3841
var items = [{ignore: 'a', name: 'a'}, {ignore: 'a', name: 'abc'}];
3942
expect(filter(items, {}).length).toBe(2);
@@ -44,11 +47,13 @@ describe('Filter: filter', function() {
4447
expect(filter(items, {name: 'b'})[0].name).toBe('abc');
4548
});
4649

50+
4751
it('should take function as predicate', function() {
4852
var items = [{name: 'a'}, {name: 'abc', done: true}];
4953
expect(filter(items, function(i) {return i.done;}).length).toBe(1);
5054
});
5155

56+
5257
it('should pass the index to a function predicate', function() {
5358
var items = [0, 1, 2, 3];
5459

@@ -59,6 +64,7 @@ describe('Filter: filter', function() {
5964
expect(result).toEqual([0, 2]);
6065
});
6166

67+
6268
it('should take object as predicate', function() {
6369
var items = [{first: 'misko', last: 'hevery'},
6470
{first: 'adam', last: 'abrons'}];
@@ -103,17 +109,19 @@ describe('Filter: filter', function() {
103109
expect(filter(items, {$: 'hevery'})[0]).toEqual(items[0]);
104110
});
105111

112+
106113
it('should support boolean properties', function() {
107114
var items = [{name: 'tom', current: true},
108-
{name: 'demi', current: false},
109-
{name: 'sofia'}];
115+
{name: 'demi', current: false},
116+
{name: 'sofia'}];
110117

111118
expect(filter(items, {current:true}).length).toBe(1);
112119
expect(filter(items, {current:true})[0].name).toBe('tom');
113120
expect(filter(items, {current:false}).length).toBe(1);
114121
expect(filter(items, {current:false})[0].name).toBe('demi');
115122
});
116123

124+
117125
it('should support negation operator', function() {
118126
var items = ['misko', 'adam'];
119127

@@ -133,8 +141,8 @@ describe('Filter: filter', function() {
133141
{key: 'value1', nonkey: 1},
134142
{key: 'value2', nonkey: 2},
135143
{key: 'value12', nonkey: 3},
136-
{key: 'value1', nonkey:4},
137-
{key: 'Value1', nonkey:5}
144+
{key: 'value1', nonkey: 4},
145+
{key: 'Value1', nonkey: 5}
138146
];
139147
expr = {key: 'value1'};
140148
expect(filter(items, expr, true)).toEqual([items[0], items[3]]);
@@ -143,21 +151,22 @@ describe('Filter: filter', function() {
143151
{key: 1, nonkey: 1},
144152
{key: 2, nonkey: 2},
145153
{key: 12, nonkey: 3},
146-
{key: 1, nonkey:4}
154+
{key: 1, nonkey: 4}
147155
];
148-
expr = { key: 1 };
156+
expr = {key: 1};
149157
expect(filter(items, expr, true)).toEqual([items[0], items[3]]);
150158

151159
expr = 12;
152160
expect(filter(items, expr, true)).toEqual([items[2]]);
153161
});
154162

163+
155164
it('and use the function given to compare values', function() {
156165
var items = [
157166
{key: 1, nonkey: 1},
158167
{key: 2, nonkey: 2},
159168
{key: 12, nonkey: 3},
160-
{key: 1, nonkey:14}
169+
{key: 1, nonkey: 14}
161170
];
162171
var expr = {key: 10};
163172
var comparator = function(obj, value) {
@@ -167,10 +176,6 @@ describe('Filter: filter', function() {
167176

168177
expr = 10;
169178
expect(filter(items, expr, comparator)).toEqual([items[2], items[3]]);
170-
171179
});
172-
173-
174180
});
175-
176181
});

0 commit comments

Comments
 (0)