From 1b19b7843aab0ada0b3fb04386bea6f13ef6b6df Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Fri, 20 Jan 2017 18:21:52 -0800 Subject: [PATCH] Test positive case of suppressBindingNotifications --- test/unit/bind.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/unit/bind.html b/test/unit/bind.html index d17821a560..5ff558335f 100644 --- a/test/unit/bind.html +++ b/test/unit/bind.html @@ -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); } });