Skip to content

Commit

Permalink
add failing test for filterBy
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Santero committed Nov 17, 2015
1 parent 6b3e6ea commit 4a098e8
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,23 @@ QUnit.test('properties values can be replaced', function() {
deepEqual(obj.get('a1bs').mapBy('name'), ['item1'], 'properties can be filtered by matching value');
});

QUnit.test('responds to change of property value on element', function() {
const a1 = { foo: true };
const a2 = { foo: true };

obj = EmberObject.extend({
a: filterBy('array', 'foo')
}).create({
array: [a1, a2]
});

deepEqual(obj.get('a'), [a1, a2], 'value is correct initially');

set(a1, 'foo', false);

deepEqual(obj.get('a'), [a2], 'responds to change of property on element');
});

[
['uniq', uniq],
['union', union]
Expand Down

0 comments on commit 4a098e8

Please sign in to comment.