Skip to content

Commit

Permalink
Add failing test for computed.filter @each with {} regression
Browse files Browse the repository at this point in the history
(cherry picked from commit 1a439ec)
  • Loading branch information
ilucin authored and rwjblue committed Nov 29, 2017
1 parent 8d6bc9a commit cbb9086
Showing 1 changed file with 18 additions and 0 deletions.
Expand Up @@ -344,6 +344,24 @@ QUnit.test('it updates as the array is replaced', function() {
deepEqual(obj.get('filtered'), [20, 22, 24], 'computed array is updated when array is changed');
});

QUnit.test('it updates properly on @each with {} dependencies', function() {
let item = EmberObject.create({prop: true});

obj = EmberObject.extend({
filtered: filter('items.@each.{prop}', function(item, index) {
return item.get('prop') === true;
})
}).create({
items: [item]
});

deepEqual(obj.get('filtered'), [item]);

item.set('prop', false);

deepEqual(obj.get('filtered'), []);
});

QUnit.module('filterBy', {
setup() {
obj = EmberObject.extend({
Expand Down

0 comments on commit cbb9086

Please sign in to comment.