mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 15:18:12 +00:00
[Fixed Position] Use FixedDragHandle for moves
Use FixedDragHandle to deal with repositioning, WTD-882.
This commit is contained in:
@ -9,6 +9,7 @@ define(
|
||||
|
||||
describe("A fixed position drag handle", function () {
|
||||
var mockElementHandle,
|
||||
mockUpdate,
|
||||
mockCommit,
|
||||
handle;
|
||||
|
||||
@ -17,6 +18,7 @@ define(
|
||||
'elementHandle',
|
||||
[ 'x', 'y' ]
|
||||
);
|
||||
mockUpdate = jasmine.createSpy('update');
|
||||
mockCommit = jasmine.createSpy('commit');
|
||||
|
||||
mockElementHandle.x.andReturn(6);
|
||||
@ -25,6 +27,7 @@ define(
|
||||
handle = new FixedDragHandle(
|
||||
mockElementHandle,
|
||||
TEST_GRID_SIZE,
|
||||
mockUpdate,
|
||||
mockCommit
|
||||
);
|
||||
});
|
||||
@ -51,6 +54,9 @@ define(
|
||||
expect(mockElementHandle.x).toHaveBeenCalledWith(5);
|
||||
expect(mockElementHandle.y).toHaveBeenCalledWith(7);
|
||||
|
||||
// Should have called update once per continueDrag
|
||||
expect(mockUpdate.calls.length).toEqual(2);
|
||||
|
||||
// Finally, ending drag should commit
|
||||
expect(mockCommit).not.toHaveBeenCalled();
|
||||
handle.endDrag();
|
||||
|
Reference in New Issue
Block a user