[Mobile, Gestures] Tests

Adjusted tests to call to correct
firedGesture.
This commit is contained in:
Shivam Dave 2015-08-11 10:57:52 -07:00
parent 3031579a62
commit caf1e3aea9
2 changed files with 26 additions and 7 deletions

View File

@ -31,7 +31,7 @@ define(
var JQLITE_FUNCTIONS = [ "on", "off", "unbind" ],
LOG_FUNCTIONS = [ "error", "warn", "info", "debug"],
DOMAIN_OBJECT_METHODS = [ "getId", "getModel",
DOMAIN_OBJECT_METHODS = [ "getName", "getModel",
"getCapability", "hasCapability", "useCapability"],
TEST_NAME = "Not Folder";
@ -63,9 +63,13 @@ define(
gesture = new PanGesture(mockLog, mockAgentService,
mockElement, mockObject);
fireStartGesture = mockElement.on.calls[0];
fireMoveGesture = mockElement.on.calls[1];
fireEndGesture = mockElement.on.calls[2];
fireStartGesture = mockElement.on.calls[0].args[1];
fireMoveGesture = mockElement.on.calls[1].args[1];
fireEndGesture = mockElement.on.calls[2].args[1];
});
it("pan", function () {
});
});
}

View File

@ -41,6 +41,9 @@ define(
mockElement,
mockDomainObject,
mockObject,
mockEvent,
mockTouchEvent,
mockChangedTouches,
gesture,
fireStartGesture,
fireMoveGesture,
@ -59,15 +62,27 @@ define(
return c === 'type' && mockDomainObject;
});
mockAgentService.isMobile.andReturn(true);
gesture = new PinchGesture(mockLog, mockAgentService,
mockElement, mockObject);
fireStartGesture = mockElement.on.calls[0];
fireMoveGesture = mockElement.on.calls[1];
fireEndGesture = mockElement.on.calls[2];
fireStartGesture = mockElement.on.calls[0].args[1];
fireMoveGesture = mockElement.on.calls[1].args[1];
fireEndGesture = mockElement.on.calls[2].args[1];
});
it("pinch", function () {
mockTouchEvent = jasmine.createSpyObj("event", ["preventDefault", "stopPropagation",
"changedTouches"]);
mockChangedTouches = jasmine.createSpyObj("changedTouch", ["length"]);
mockChangedTouches.length.andReturn(2);
mockTouchEvent.changedTouches.andReturn(mockChangedTouches);
fireStartGesture(mockTouchEvent);
// fireMoveGesture(mockTouchEvent);
// fireEndGesture(mockTouchEvent);
});
});
}