mirror of
https://github.com/nasa/openmct.git
synced 2025-06-24 02:04:02 +00:00
[Gestures] Browse/Edit Composition
Disallows drag and drop during browse mode, unless dragging and dropping into a folder view. Allows drag and drop into a layout view only in edit mode also. Can be unit tested now. WTD-11.
This commit is contained in:
@ -132,15 +132,32 @@ define(
|
||||
expect(mockEvent.dataTransfer.dropEffect).toBeDefined();
|
||||
});
|
||||
|
||||
it("invokes compose on drop", function () {
|
||||
it("invokes compose on drop in browse", function () {
|
||||
callbacks.dragover(mockEvent);
|
||||
expect(mockAction.getActions).toHaveBeenCalledWith({
|
||||
key: 'compose',
|
||||
selectedObject: mockDraggedObject
|
||||
});
|
||||
callbacks.drop(mockEvent);
|
||||
expect(mockCompose.perform).toHaveBeenCalled();
|
||||
mockDomainObject.useCapability('browse');
|
||||
var mockDomainObjectType = mockDomainObject.getModel().type;
|
||||
// if (mockDomainObjectType === 'folder' || mockDomainObject.hasCapability('editor') {
|
||||
expect((mockCompose.perform)).toHaveBeenCalled();
|
||||
// }
|
||||
});
|
||||
|
||||
// it("invokes compose on drop in edit", function () {
|
||||
// callbacks.dragover(mockEvent);
|
||||
// expect(mockAction.getActions).toHaveBeenCalledWith({
|
||||
// key: 'compose',
|
||||
// selectedObject: mockDraggedObject
|
||||
// });
|
||||
// callbacks.drop(mockEvent);
|
||||
// mockDomainObject.useCapability('editor');
|
||||
// if (mockDomainObjectType === 'folder' || mockDomainObject.hasCapability('editor') {
|
||||
// expect((mockCompose.perform)).toHaveBeenCalled();
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
it("broadcasts drop position", function () {
|
||||
|
Reference in New Issue
Block a user