[Representation] Pass ID through dndService

Pass ID as well as full domain object through dndService,
to support drag-drop behavior like WTD-988.
This commit is contained in:
Victor Woeltjen
2015-03-19 12:39:13 -07:00
parent 818510da14
commit f9290b8e42
3 changed files with 25 additions and 3 deletions

View File

@@ -65,6 +65,10 @@ define(
handlers.dragstart({ dataTransfer: mockDataTransfer });
expect(mockDndService.setData).toHaveBeenCalledWith(
GestureConstants.MCT_DRAG_TYPE,
TEST_ID
);
expect(mockDndService.setData).toHaveBeenCalledWith(
GestureConstants.MCT_EXTENDED_DRAG_TYPE,
mockDomainObject
);
});
@@ -78,8 +82,12 @@ define(
// End the drag
handlers.dragend({ dataTransfer: mockDataTransfer });
// Should have removed the data that was attached
expect(mockDndService.removeData)
.toHaveBeenCalledWith(GestureConstants.MCT_DRAG_TYPE);
expect(mockDndService.removeData)
.toHaveBeenCalledWith(GestureConstants.MCT_EXTENDED_DRAG_TYPE);
});
it("logs a warning if dataTransfer cannot be set", function () {