Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix expectations for event preventing

  • Loading branch information...
commit 47d768b5a1c3d469c85fbea9254080c28a21061c 1 parent a5a65e4
@davidaurelio davidaurelio authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 test/renderer/svg-spec.js
View
8 test/renderer/svg-spec.js
@@ -34,11 +34,13 @@ 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')
};
@@ -46,10 +48,12 @@ define(['bonsai/renderer/svg/svg'], function(SvgRenderer) {
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')
};
Please sign in to comment.
Something went wrong with that request. Please try again.