mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 07:00:49 +00:00
[Mobile, Gestures] Tests
Adjusted tests to call to correct firedGesture.
This commit is contained in:
parent
3031579a62
commit
caf1e3aea9
@ -31,7 +31,7 @@ define(
|
|||||||
|
|
||||||
var JQLITE_FUNCTIONS = [ "on", "off", "unbind" ],
|
var JQLITE_FUNCTIONS = [ "on", "off", "unbind" ],
|
||||||
LOG_FUNCTIONS = [ "error", "warn", "info", "debug"],
|
LOG_FUNCTIONS = [ "error", "warn", "info", "debug"],
|
||||||
DOMAIN_OBJECT_METHODS = [ "getId", "getModel",
|
DOMAIN_OBJECT_METHODS = [ "getName", "getModel",
|
||||||
"getCapability", "hasCapability", "useCapability"],
|
"getCapability", "hasCapability", "useCapability"],
|
||||||
TEST_NAME = "Not Folder";
|
TEST_NAME = "Not Folder";
|
||||||
|
|
||||||
@ -63,9 +63,13 @@ define(
|
|||||||
|
|
||||||
gesture = new PanGesture(mockLog, mockAgentService,
|
gesture = new PanGesture(mockLog, mockAgentService,
|
||||||
mockElement, mockObject);
|
mockElement, mockObject);
|
||||||
fireStartGesture = mockElement.on.calls[0];
|
fireStartGesture = mockElement.on.calls[0].args[1];
|
||||||
fireMoveGesture = mockElement.on.calls[1];
|
fireMoveGesture = mockElement.on.calls[1].args[1];
|
||||||
fireEndGesture = mockElement.on.calls[2];
|
fireEndGesture = mockElement.on.calls[2].args[1];
|
||||||
|
});
|
||||||
|
|
||||||
|
it("pan", function () {
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,9 @@ define(
|
|||||||
mockElement,
|
mockElement,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
mockObject,
|
mockObject,
|
||||||
|
mockEvent,
|
||||||
|
mockTouchEvent,
|
||||||
|
mockChangedTouches,
|
||||||
gesture,
|
gesture,
|
||||||
fireStartGesture,
|
fireStartGesture,
|
||||||
fireMoveGesture,
|
fireMoveGesture,
|
||||||
@ -59,15 +62,27 @@ define(
|
|||||||
return c === 'type' && mockDomainObject;
|
return c === 'type' && mockDomainObject;
|
||||||
});
|
});
|
||||||
mockAgentService.isMobile.andReturn(true);
|
mockAgentService.isMobile.andReturn(true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gesture = new PinchGesture(mockLog, mockAgentService,
|
gesture = new PinchGesture(mockLog, mockAgentService,
|
||||||
mockElement, mockObject);
|
mockElement, mockObject);
|
||||||
fireStartGesture = mockElement.on.calls[0];
|
|
||||||
fireMoveGesture = mockElement.on.calls[1];
|
fireStartGesture = mockElement.on.calls[0].args[1];
|
||||||
fireEndGesture = mockElement.on.calls[2];
|
fireMoveGesture = mockElement.on.calls[1].args[1];
|
||||||
|
fireEndGesture = mockElement.on.calls[2].args[1];
|
||||||
});
|
});
|
||||||
|
|
||||||
it("pinch", function () {
|
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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user