Skip to content

Commit bf51175

Browse files
added test for fix: event context should be bound to flow instance not global window object
1 parent c55b201 commit bf51175

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/eventsSpec.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ describe('events', function() {
1717
expect(valid).toBeTruthy();
1818
});
1919

20+
it('should have a context of flow instance', function() {
21+
var context = null;
22+
flow.on('test', function () {
23+
context = this;
24+
});
25+
flow.fire('test');
26+
expect(context).toEqual(flow);
27+
});
28+
2029
it('should pass some arguments', function() {
2130
var valid = false;
2231
var argumentOne = 123;
@@ -101,4 +110,4 @@ describe('events', function() {
101110
expect(event).not.toHaveBeenCalled();
102111
});
103112
});
104-
});
113+
});

0 commit comments

Comments
 (0)