From 451842fb82c8161847f98e3b3053c68d2eabc4ac Mon Sep 17 00:00:00 2001 From: Sarah Hale Date: Thu, 18 Jun 2015 14:29:46 -0700 Subject: [PATCH] [Browse composition] Cleanup Removed commented out code in tests. Issue 11. --- .../src/gestures/DropGesture.js | 1 + .../test/gestures/DropGestureSpec.js | 43 ------------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/platform/representation/src/gestures/DropGesture.js b/platform/representation/src/gestures/DropGesture.js index 3cfcae1b87..e4f1154262 100644 --- a/platform/representation/src/gestures/DropGesture.js +++ b/platform/representation/src/gestures/DropGesture.js @@ -112,6 +112,7 @@ define( // Informs user that drag and drop is not allowed. // window.alert("Cannot drag and drop objects during browse mode."); } + } // We can only handle drops if we have access to actions... diff --git a/platform/representation/test/gestures/DropGestureSpec.js b/platform/representation/test/gestures/DropGestureSpec.js index 88154a9cdf..6481eefa32 100644 --- a/platform/representation/test/gestures/DropGestureSpec.js +++ b/platform/representation/test/gestures/DropGestureSpec.js @@ -132,35 +132,6 @@ define( expect(mockEvent.dataTransfer.dropEffect).toBeDefined(); }); -/* - it("invokes compose on drop in browse", function () { - callbacks.dragover(mockEvent); - expect(mockAction.getActions).toHaveBeenCalledWith({ - key: 'compose', - selectedObject: mockDraggedObject - }); - callbacks.drop(mockEvent); - 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("invokes compose on drop in edit mode", function () { // Set the mockDomainObject to have the editor capability mockDomainObject.hasCapability.andReturn(true); @@ -206,20 +177,6 @@ define( expect(mockCompose.perform).toHaveBeenCalled(); }); - /* - it("does not invoke compose on drop in browse mode for non-folders", function () { - if (mockDomainObject.hasCapability('editor') === false && !(domainObject.getModel().type === 'folder')) { - callbacks.dragover(mockEvent); - expect(mockAction.getActions).toHaveBeenCalledWith({ - key: 'compose', - selectedObject: mockDraggedObject - }); - callbacks.drop(mockEvent); - expect(mockCompose.perform).not.toHaveBeenCalled(); - } - }); - */ - it("broadcasts drop position (in edit mode)", function () { // Set the mockDomainObject to have the editor capability mockDomainObject.hasCapability.andReturn(true);