From 556296096daa4229b1846f42c06ca4939c9a9833 Mon Sep 17 00:00:00 2001 From: Deep Tailor Date: Tue, 29 Aug 2017 10:34:44 -0700 Subject: [PATCH] fix tests to correspond with changes made to MCTSplitPane --- .../general/test/directives/MCTSplitPaneSpec.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js b/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js index abd0935021..2417ccd2b9 100644 --- a/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js +++ b/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js @@ -140,7 +140,7 @@ define( it("exposes its splitter's initial position", function () { expect(controller.position()).toEqual( - mockFirstPane[0].offsetWidth + mockSplitter[0].offsetWidth + mockFirstPane[0].offsetWidth ); }); @@ -164,11 +164,12 @@ define( }); it("allows positions to be set", function () { + var intitialValue = mockChildren[0].offsetWidth; var testValue = mockChildren[0].offsetWidth + 50; - controller.position(testValue); + controller.position(intitialValue, testValue); expect(mockFirstPane.css).toHaveBeenCalledWith( 'width', - (testValue - mockSplitter[0].offsetWidth) + 'px' + (testValue) + 'px' ); }); @@ -200,11 +201,11 @@ define( mockFirstPane[0].offsetWidth += 100; // Should not reflect the change yet expect(controller.position()).not.toEqual( - mockFirstPane[0].offsetWidth + mockSplitter[0].offsetWidth + mockFirstPane[0].offsetWidth ); mockInterval.mostRecentCall.args[0](); expect(controller.position()).toEqual( - mockFirstPane[0].offsetWidth + mockSplitter[0].offsetWidth + mockFirstPane[0].offsetWidth ); }); @@ -216,7 +217,7 @@ define( it("saves user preference to localStorage when user is done resizing", function () { controller.endResizing(100); - expect(Number(mockWindow.localStorage.getItem('mctSplitPane-rightSide'))).toEqual(100 - mockSplitter[0].offsetWidth); + expect(Number(mockWindow.localStorage.getItem('mctSplitPane-rightSide'))).toEqual(100); }); });