We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27d26b8 commit 273a81bCopy full SHA for 273a81b
1 file changed
test/bind.js
@@ -199,4 +199,19 @@ describe('bind', () => {
199
instance.querySelector('button').click()
200
expect(instance.foo).to.have.been.called.exactly(1)
201
})
202
+
203
+ it('will not fire if the binding attribute is removed', () => {
204
+ const instance = document.createElement('bind-test-element')
205
+ chai.spy.on(instance, 'foo')
206
+ const el1 = document.createElement('div')
207
+ el1.setAttribute('data-action', 'click:bind-test-element#foo')
208
+ instance.appendChild(el1)
209
+ bind(instance)
210
+ expect(instance.foo).to.have.not.been.called()
211
+ el1.click()
212
+ expect(instance.foo).to.have.been.called.exactly(1)
213
+ el1.setAttribute('data-action', 'click:other-element#foo')
214
215
216
+ })
217
0 commit comments