From 83bdf7343d1145014d2ebc3ab0eade57b9c71b08 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 5 Jan 2016 10:14:25 -0800 Subject: [PATCH] [Common UI] Test mct-splitter WTD-1400 --- .../test/directives/MCTSplitterSpec.js | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/platform/commonUI/general/test/directives/MCTSplitterSpec.js b/platform/commonUI/general/test/directives/MCTSplitterSpec.js index f95c082905..3aae62ccc2 100644 --- a/platform/commonUI/general/test/directives/MCTSplitterSpec.js +++ b/platform/commonUI/general/test/directives/MCTSplitterSpec.js @@ -74,6 +74,39 @@ define( expect(mockElement.addClass) .toHaveBeenCalledWith('splitter'); }); + + describe("and then manipulated", function () { + var testPosition; + + beforeEach(function () { + testPosition = 12321; + mockSplitPane.position.andReturn(testPosition); + mockSplitPane.anchor.andReturn({ + orientation: 'vertical', + reversed: false + }); + mockScope.splitter.startMove(); + }); + + it("adds a 'resizing' class", function () { + expect(mockSplitPane.toggleClass) + .toHaveBeenCalledWith('resizing'); + }); + + it("repositions during drag", function () { + mockScope.splitter.move([ 10, 0 ]); + expect(mockSplitPane.position) + .toHaveBeenCalledWith(testPosition + 10); + }); + + it("removes the 'resizing' class when finished", function () { + mockSplitPane.toggleClass.reset(); + mockScope.splitter.endMove(); + expect(mockSplitPane.toggleClass) + .toHaveBeenCalledWith('resizing'); + }); + + }); }); }); }