Skip to content

Commit

Permalink
Test positive case of suppressBindingNotifications
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jan 21, 2017
1 parent ad7f91d commit 1b19b78
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,13 @@
});

test('listener for value-changed fires when value changed from host', function() {
var listener = sinon.spy();
el.$.basic1.addEventListener('notifyingvalue-changed', listener);
el.boundnotifyingvalue = 678;
assert.equal(el.$.basic1.notifyingvalue, 678);
assert.equal(listener.callCount,
Polymer.Settings.suppressBindingNotifications ? 0 : 1);
if (!Polymer.Settings.suppressBindingNotifications) {
var listener = sinon.spy();
el.$.basic1.addEventListener('notifyingvalue-changed', listener);
el.boundnotifyingvalue = 678;
assert.equal(el.$.basic1.notifyingvalue, 678);
assert.isTrue(listener.calledOnce);
assert.equal(listener.getCalls()[0].args[0].detail.value, 678);
}
});
Expand Down

0 comments on commit 1b19b78

Please sign in to comment.