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

fix typo in descriptions and add test to match blank object attribute #8004

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions test/ng/filter/filterSpec.js
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ describe('Filter: filter', function() {
expect(filter(items, function(i) {return i.done;}).length).toBe(1);
});

it('should take object as perdicate', function() {
it('should take object as predicate', function() {
var items = [{first: 'misko', last: 'hevery'},
{first: 'adam', last: 'abrons'}];

@@ -61,7 +61,7 @@ describe('Filter: filter', function() {
});


it('should support predicat object with dots in the name', function() {
it('should support predicate object with dots in the name', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these aren't really related to the test addition

var items = [{'first.name': 'misko', 'last.name': 'hevery'},
{'first.name': 'adam', 'last.name': 'abrons'}];

@@ -81,7 +81,6 @@ describe('Filter: filter', function() {
]);
});


it('should match any properties for given "$" property', function() {
var items = [{first: 'tom', last: 'hevery'},
{first: 'adam', last: 'hevery', alias: 'tom', done: false},
@@ -160,6 +159,15 @@ describe('Filter: filter', function() {

});

it('should be able to use exact match to match empty strings', function() {
var items = [{person: {name: 'John'}},
{person: {name: 'Rita'}},
{person: {name: 'Billy'}},
{person: {name: ''}},
{person: {name: 'Joan'}}];
expect(filter(items, {person: {name: ''}}).length).toBe(5);
expect(filter(items, {person: {name: ''}}, true).length).toBe(1);
});

});