diff options
author | Mario Schlicht <mario.schlicht@tracetronic.de> | 2022-01-18 08:01:58 +0100 |
---|---|---|
committer | Mario Schlicht <mario.schlicht@tracetronic.de> | 2022-01-18 08:01:58 +0100 |
commit | 5098597cb14df8a0be9249fcabbdf5b6d126cd85 (patch) | |
tree | 89fff4e0144e3f4d8e60e0a75964e4e8c34c8e9c /spec | |
parent | 480e5d77e2dcefd6bc4f95a053bb545d9916eb72 (diff) | |
download | svg.js-5098597cb14df8a0be9249fcabbdf5b6d126cd85.tar.gz svg.js-5098597cb14df8a0be9249fcabbdf5b6d126cd85.zip |
Add parameter "options" to EventTarget.off()
- additional: Typescript-Interfaces for off() functions updated
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()', () => { |