Permalink
Browse files

Fix expectations for event preventing

  • Loading branch information...
1 parent a5a65e4 commit 47d768b5a1c3d469c85fbea9254080c28a21061c @davidaurelio davidaurelio committed Mar 6, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 test/renderer/svg-spec.js
@@ -34,22 +34,26 @@ define(['bonsai/renderer/svg/svg'], function(SvgRenderer) {
expect(event.preventDefault).not.toHaveBeenCalled();
});
- it('should call .preventDefault() on events when allowEventDefaults is set to false', function() {
+ it('should call .preventDefault() on events when allowEventDefaults is set to false and the event type is "touchmove"', function() {
var renderer = createSvgRenderer();
renderer.allowEventDefaults = false;
var event = {
+ type: "touchmove",
+ changedTouches: [],
target: createFakeDomNode(),
preventDefault: jasmine.createSpy('preventDefault')
};
renderer.handleEvent(event);
expect(event.preventDefault).toHaveBeenCalled();
});
- it('should call .preventDefault() on events when allowEventDefaults is not set', function() {
+ it('should call .preventDefault() on events when allowEventDefaults is not set and the event type is "touchmove"', function() {
var renderer = createSvgRenderer();
var event = {
+ type: "touchmove",
+ changedTouches: [],
target: createFakeDomNode(),
preventDefault: jasmine.createSpy('preventDefault')
};

0 comments on commit 47d768b

Please sign in to comment.