Skip to content

Commit

Permalink
Add failing test for observer computed reads 2.16 regression
Browse files Browse the repository at this point in the history
  • Loading branch information
ilucin authored and bekzod committed Nov 12, 2017
1 parent 1396bec commit 250e10a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/ember-runtime/tests/system/object/computed_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,16 @@ QUnit.test('Calling _super in apply outside the immediate function of a CP gette

ok(emberGet(SubClass.create(), 'foo'), 'FOO', 'super value is fetched');
});

QUnit.test('observing computed.reads prop and overriding it in create() works', function() {
let Obj = EmberObject.extend({
name: computed.reads('model.name'),
nameDidChange: observer('name', function() {})
});

let obj1 = Obj.create({name: '1'});
let obj2 = Obj.create({name: '2'});

equal(obj1.get('name'), '1');
equal(obj2.get('name'), '2');
});

0 comments on commit 250e10a

Please sign in to comment.