Skip to content

Commit

Permalink
added test for fix: event context should be bound to flow instance no…
Browse files Browse the repository at this point in the history
…t global window object
  • Loading branch information
natural-affinity committed Jan 31, 2015
1 parent c55b201 commit bf51175
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/eventsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ describe('events', function() {
expect(valid).toBeTruthy();
});

it('should have a context of flow instance', function() {
var context = null;
flow.on('test', function () {
context = this;
});
flow.fire('test');
expect(context).toEqual(flow);
});

it('should pass some arguments', function() {
var valid = false;
var argumentOne = 123;
Expand Down Expand Up @@ -101,4 +110,4 @@ describe('events', function() {
expect(event).not.toHaveBeenCalled();
});
});
});
});

0 comments on commit bf51175

Please sign in to comment.