summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/event.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/spec/event.js b/spec/spec/event.js
index 678c7b9..9c945d0 100644
--- a/spec/spec/event.js
+++ b/spec/spec/event.js
@@ -332,6 +332,10 @@ describe('Event', function() {
dispatchEvent(rect.on('event', action), 'event')
expect(context).toBe(rect)
})
+ it('applies given object as context', function() {
+ dispatchEvent(rect.on('event', action, this), 'event')
+ expect(context).toBe(this)
+ })
it('stores the listener for future reference', function() {
rect.on('event', action)
expect(SVG.listeners[SVG.handlerMap.indexOf(rect.node)]['event']['*'][action]).not.toBeUndefined()