From 717fa5edf4703270fd9d903ef7dc7f78cf98fabb Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 30 Oct 2017 12:42:18 -0700 Subject: [PATCH] [Timeline] Test MCTResourceGraphDrop's drop handler --- .../directives/MCTResourceGraphDropSpec.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/platform/features/timeline/test/directives/MCTResourceGraphDropSpec.js b/platform/features/timeline/test/directives/MCTResourceGraphDropSpec.js index 613f886ebe..e2b09792d9 100644 --- a/platform/features/timeline/test/directives/MCTResourceGraphDropSpec.js +++ b/platform/features/timeline/test/directives/MCTResourceGraphDropSpec.js @@ -107,6 +107,31 @@ define( .toHaveBeenCalled(); }); }); + + describe("on drop", function () { + var prefix = !graphing ? "does" : "does not"; + + beforeEach(function () { + handlers.drop(testEvent); + }); + + it("removes any drop-over class", function () { + expect(mockElement.removeClass) + .toHaveBeenCalledWith('drop-over'); + }); + + it(prefix + " toggle the swimlane's resource graph", function () { + var expectToggle = expect(mockSwimlane.toggleGraph); + (!graphing ? expectToggle : expectToggle.not) + .toHaveBeenCalled(); + }); + + it(prefix + " prevent default", function () { + var expectPreventDefault = expect(testEvent.preventDefault); + (!graphing ? expectPreventDefault : expectPreventDefault.not) + .toHaveBeenCalled(); + }); + }); }); });