diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/types/EventTarget.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/spec/types/EventTarget.js b/spec/spec/types/EventTarget.js index e27a71c..82e5a94 100644 --- a/spec/spec/types/EventTarget.js +++ b/spec/spec/types/EventTarget.js @@ -101,6 +101,17 @@ describe('EventTarget.js', () => { target.dispatch('event') expect(spy.calls.count()).toBe(1) }) + + it('removes an event binding with options from the target', () => { + const target = new EventTarget() + const spy = createSpy() + target.on('event', spy, undefined, { capture: true }) + target.dispatch('event') + expect(spy.calls.count()).toBe(1) + target.off('event', spy, { capture: true }) + target.dispatch('event') + expect(spy.calls.count()).toBe(1) + }) }) describe('on()', () => { |