From 8b7a94dcf868635e991ab582f12eb42ed2586ddf Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 22 Sep 2015 11:14:55 -0700 Subject: [PATCH] [Style] Remove unused variables, excess whitespace Clean up unused variables and excess whitespace to match style guide. --- .../controllers/TreeNodeControllerSpec.js | 10 ++-------- .../test/gestures/InfoButtonGestureSpec.js | 19 +++++++++--------- .../inspect/test/gestures/InfoGestureSpec.js | 2 +- .../test/actions/ContextMenuActionSpec.js | 20 +++++-------------- 4 files changed, 17 insertions(+), 34 deletions(-) diff --git a/platform/commonUI/general/test/controllers/TreeNodeControllerSpec.js b/platform/commonUI/general/test/controllers/TreeNodeControllerSpec.js index 52a8271bf2..62a40d0586 100644 --- a/platform/commonUI/general/test/controllers/TreeNodeControllerSpec.js +++ b/platform/commonUI/general/test/controllers/TreeNodeControllerSpec.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/ +/*global define,describe,it,expect,beforeEach,jasmine*/ define( ["../../src/controllers/TreeNodeController"], @@ -29,8 +29,6 @@ define( describe("The tree node controller", function () { var mockScope, mockTimeout, - mockAgentService, - mockNgModel, mockDomainObject, controller; @@ -46,16 +44,12 @@ define( beforeEach(function () { mockScope = jasmine.createSpyObj("$scope", ["$watch", "$on", "$emit"]); mockTimeout = jasmine.createSpy("$timeout"); - mockAgentService = jasmine.createSpyObj("agentService", ["isMobile", "isPhone", "getOrientation"]); mockDomainObject = jasmine.createSpyObj( "domainObject", [ "getId", "getCapability", "getModel", "useCapability" ] ); - mockAgentService.getOrientation.andReturn("portrait"); - mockAgentService.isPhone.andReturn(true); - - controller = new TreeNodeController(mockScope, mockTimeout, mockAgentService); + controller = new TreeNodeController(mockScope, mockTimeout); }); it("allows tracking of expansion state", function () { diff --git a/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js b/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js index 036a77685b..0c48f5d940 100644 --- a/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js +++ b/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/ +/*global define,describe,it,expect,beforeEach,jasmine*/ define( ['../../src/gestures/InfoButtonGesture'], @@ -38,12 +38,11 @@ define( mockScope, mockOff, testMetadata, - mockPromise, mockHide, gesture, fireGesture, fireDismissGesture; - + beforeEach(function () { mockTimeout = jasmine.createSpy('$timeout'); mockDocument = jasmine.createSpyObj('$document', ['find']); @@ -62,7 +61,7 @@ define( 'domainObject', [ 'getId', 'getCapability', 'useCapability', 'getModel' ] ); - + mockEvent = jasmine.createSpyObj("event", ["preventDefault", "stopPropagation"]); mockEvent.pageX = 0; mockEvent.pageY = 0; @@ -88,7 +87,7 @@ define( ); fireGesture = mockElement.on.mostRecentCall.args[1]; }); - + it("expect click on the representation", function () { // Fires a click call on element and then // expects the click to have happened @@ -98,7 +97,7 @@ define( jasmine.any(Function) ); }); - + it("expect click then dismiss on the representation", function () { // Fire the click and then expect the click fireGesture(mockEvent); @@ -106,14 +105,14 @@ define( "click", jasmine.any(Function) ); - + // Get the touch start on the body // and fire the dismiss gesture fireDismissGesture = mockBody.on.mostRecentCall.args[1]; fireDismissGesture(mockEvent); // Expect Body to have been touched, event.preventDefault() // to be called, then the mockBody listener to be detached - // lastly unbind the touchstart used to dismiss so other + // lastly unbind the touchstart used to dismiss so other // events can be called expect(mockBody.on).toHaveBeenCalledWith( "touchstart", @@ -128,7 +127,7 @@ define( 'touchstart' ); }); - + it("detaches a callback for info bubble events when destroyed", function () { expect(mockElement.off).not.toHaveBeenCalled(); @@ -139,7 +138,7 @@ define( jasmine.any(Function) ); }); - + }); } ); diff --git a/platform/commonUI/inspect/test/gestures/InfoGestureSpec.js b/platform/commonUI/inspect/test/gestures/InfoGestureSpec.js index 28408a2a7c..d25fa57ed3 100644 --- a/platform/commonUI/inspect/test/gestures/InfoGestureSpec.js +++ b/platform/commonUI/inspect/test/gestures/InfoGestureSpec.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/ +/*global define,describe,it,expect,beforeEach,jasmine*/ define( ['../../src/gestures/InfoGesture'], diff --git a/platform/representation/test/actions/ContextMenuActionSpec.js b/platform/representation/test/actions/ContextMenuActionSpec.js index d9b18e41b6..233d6c6bf0 100644 --- a/platform/representation/test/actions/ContextMenuActionSpec.js +++ b/platform/representation/test/actions/ContextMenuActionSpec.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/ +/*global define,describe,it,expect,beforeEach,jasmine*/ /** @@ -49,18 +49,8 @@ define( mockDomainObject, mockEvent, mockActionContext, - mockNavigator, - mockStopPropagation, action; - function fireEvent(evt, value) { - mockElement.on.calls.forEach(function (call) { - if (call.args[0] === evt) { - call.args[1](value); - } - }); - } - beforeEach(function () { mockCompile = jasmine.createSpy("$compile"); mockCompiledTemplate = jasmine.createSpy("template"); @@ -83,7 +73,7 @@ define( mockRootScope.$new.andReturn(mockScope); mockActionContext = {key: 'menu', domainObject: mockDomainObject, event: mockEvent}; - + action = new ContextMenuAction( mockCompile, mockDocument, @@ -169,7 +159,7 @@ define( // Menu should have been removed expect(mockMenu.remove).toHaveBeenCalled(); }); - + it("keeps a menu when menu is clicked", function () { // Show the menu action.perform(); @@ -186,7 +176,7 @@ define( // Listener should have been detached from body expect(mockBody.off).not.toHaveBeenCalled(); }); - + it("keeps a menu when menu is clicked on mobile", function () { mockAgentService.isMobile.andReturn(true); action = new ContextMenuAction( @@ -198,7 +188,7 @@ define( mockActionContext ); action.perform(); - + mockMenu.on.calls.forEach(function (call) { if (call.args[0] === 'touchstart') { call.args[1](mockEvent);