Skip to content

Commit

Permalink
Failing tests for ArrayProxy#length cacheing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bmac committed Aug 26, 2015
1 parent 311ae50 commit 941f245
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ QUnit.test('should update length for null content', function() {
equal(proxy.get('length'), 0, 'length updates');
});

QUnit.test('should update length for null content when there is a computed property watching length', function() {
var proxy = ArrayProxy.extend({
isEmpty: Ember.computed.not('length')
}).create({
content: Ember.A([1, 2, 3])
});

equal(proxy.get('length'), 3, 'precond - length is 3');

// Consume computed property that depends on length
proxy.get('isEmpty');

// update content
proxy.set('content', null);

equal(proxy.get('length'), 0, 'length updates');
});

QUnit.test('The `arrangedContentWillChange` method is invoked before `content` is changed.', function() {
var callCount = 0;
var expectedLength;
Expand Down

0 comments on commit 941f245

Please sign in to comment.