mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 15:10:50 +00:00
[Style] Remove unused variables, excess whitespace
Clean up unused variables and excess whitespace to match style guide.
This commit is contained in:
parent
3e5d294a28
commit
8b7a94dcf8
@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* 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(
|
define(
|
||||||
["../../src/controllers/TreeNodeController"],
|
["../../src/controllers/TreeNodeController"],
|
||||||
@ -29,8 +29,6 @@ define(
|
|||||||
describe("The tree node controller", function () {
|
describe("The tree node controller", function () {
|
||||||
var mockScope,
|
var mockScope,
|
||||||
mockTimeout,
|
mockTimeout,
|
||||||
mockAgentService,
|
|
||||||
mockNgModel,
|
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
controller;
|
controller;
|
||||||
|
|
||||||
@ -46,16 +44,12 @@ define(
|
|||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockScope = jasmine.createSpyObj("$scope", ["$watch", "$on", "$emit"]);
|
mockScope = jasmine.createSpyObj("$scope", ["$watch", "$on", "$emit"]);
|
||||||
mockTimeout = jasmine.createSpy("$timeout");
|
mockTimeout = jasmine.createSpy("$timeout");
|
||||||
mockAgentService = jasmine.createSpyObj("agentService", ["isMobile", "isPhone", "getOrientation"]);
|
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
mockDomainObject = jasmine.createSpyObj(
|
||||||
"domainObject",
|
"domainObject",
|
||||||
[ "getId", "getCapability", "getModel", "useCapability" ]
|
[ "getId", "getCapability", "getModel", "useCapability" ]
|
||||||
);
|
);
|
||||||
|
|
||||||
mockAgentService.getOrientation.andReturn("portrait");
|
controller = new TreeNodeController(mockScope, mockTimeout);
|
||||||
mockAgentService.isPhone.andReturn(true);
|
|
||||||
|
|
||||||
controller = new TreeNodeController(mockScope, mockTimeout, mockAgentService);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("allows tracking of expansion state", function () {
|
it("allows tracking of expansion state", function () {
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* 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(
|
define(
|
||||||
['../../src/gestures/InfoButtonGesture'],
|
['../../src/gestures/InfoButtonGesture'],
|
||||||
@ -38,12 +38,11 @@ define(
|
|||||||
mockScope,
|
mockScope,
|
||||||
mockOff,
|
mockOff,
|
||||||
testMetadata,
|
testMetadata,
|
||||||
mockPromise,
|
|
||||||
mockHide,
|
mockHide,
|
||||||
gesture,
|
gesture,
|
||||||
fireGesture,
|
fireGesture,
|
||||||
fireDismissGesture;
|
fireDismissGesture;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockTimeout = jasmine.createSpy('$timeout');
|
mockTimeout = jasmine.createSpy('$timeout');
|
||||||
mockDocument = jasmine.createSpyObj('$document', ['find']);
|
mockDocument = jasmine.createSpyObj('$document', ['find']);
|
||||||
@ -62,7 +61,7 @@ define(
|
|||||||
'domainObject',
|
'domainObject',
|
||||||
[ 'getId', 'getCapability', 'useCapability', 'getModel' ]
|
[ 'getId', 'getCapability', 'useCapability', 'getModel' ]
|
||||||
);
|
);
|
||||||
|
|
||||||
mockEvent = jasmine.createSpyObj("event", ["preventDefault", "stopPropagation"]);
|
mockEvent = jasmine.createSpyObj("event", ["preventDefault", "stopPropagation"]);
|
||||||
mockEvent.pageX = 0;
|
mockEvent.pageX = 0;
|
||||||
mockEvent.pageY = 0;
|
mockEvent.pageY = 0;
|
||||||
@ -88,7 +87,7 @@ define(
|
|||||||
);
|
);
|
||||||
fireGesture = mockElement.on.mostRecentCall.args[1];
|
fireGesture = mockElement.on.mostRecentCall.args[1];
|
||||||
});
|
});
|
||||||
|
|
||||||
it("expect click on the representation", function () {
|
it("expect click on the representation", function () {
|
||||||
// Fires a click call on element and then
|
// Fires a click call on element and then
|
||||||
// expects the click to have happened
|
// expects the click to have happened
|
||||||
@ -98,7 +97,7 @@ define(
|
|||||||
jasmine.any(Function)
|
jasmine.any(Function)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("expect click then dismiss on the representation", function () {
|
it("expect click then dismiss on the representation", function () {
|
||||||
// Fire the click and then expect the click
|
// Fire the click and then expect the click
|
||||||
fireGesture(mockEvent);
|
fireGesture(mockEvent);
|
||||||
@ -106,14 +105,14 @@ define(
|
|||||||
"click",
|
"click",
|
||||||
jasmine.any(Function)
|
jasmine.any(Function)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get the touch start on the body
|
// Get the touch start on the body
|
||||||
// and fire the dismiss gesture
|
// and fire the dismiss gesture
|
||||||
fireDismissGesture = mockBody.on.mostRecentCall.args[1];
|
fireDismissGesture = mockBody.on.mostRecentCall.args[1];
|
||||||
fireDismissGesture(mockEvent);
|
fireDismissGesture(mockEvent);
|
||||||
// Expect Body to have been touched, event.preventDefault()
|
// Expect Body to have been touched, event.preventDefault()
|
||||||
// to be called, then the mockBody listener to be detached
|
// 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
|
// events can be called
|
||||||
expect(mockBody.on).toHaveBeenCalledWith(
|
expect(mockBody.on).toHaveBeenCalledWith(
|
||||||
"touchstart",
|
"touchstart",
|
||||||
@ -128,7 +127,7 @@ define(
|
|||||||
'touchstart'
|
'touchstart'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("detaches a callback for info bubble events when destroyed", function () {
|
it("detaches a callback for info bubble events when destroyed", function () {
|
||||||
expect(mockElement.off).not.toHaveBeenCalled();
|
expect(mockElement.off).not.toHaveBeenCalled();
|
||||||
|
|
||||||
@ -139,7 +138,7 @@ define(
|
|||||||
jasmine.any(Function)
|
jasmine.any(Function)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* 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(
|
define(
|
||||||
['../../src/gestures/InfoGesture'],
|
['../../src/gestures/InfoGesture'],
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* 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,
|
mockDomainObject,
|
||||||
mockEvent,
|
mockEvent,
|
||||||
mockActionContext,
|
mockActionContext,
|
||||||
mockNavigator,
|
|
||||||
mockStopPropagation,
|
|
||||||
action;
|
action;
|
||||||
|
|
||||||
function fireEvent(evt, value) {
|
|
||||||
mockElement.on.calls.forEach(function (call) {
|
|
||||||
if (call.args[0] === evt) {
|
|
||||||
call.args[1](value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockCompile = jasmine.createSpy("$compile");
|
mockCompile = jasmine.createSpy("$compile");
|
||||||
mockCompiledTemplate = jasmine.createSpy("template");
|
mockCompiledTemplate = jasmine.createSpy("template");
|
||||||
@ -83,7 +73,7 @@ define(
|
|||||||
mockRootScope.$new.andReturn(mockScope);
|
mockRootScope.$new.andReturn(mockScope);
|
||||||
|
|
||||||
mockActionContext = {key: 'menu', domainObject: mockDomainObject, event: mockEvent};
|
mockActionContext = {key: 'menu', domainObject: mockDomainObject, event: mockEvent};
|
||||||
|
|
||||||
action = new ContextMenuAction(
|
action = new ContextMenuAction(
|
||||||
mockCompile,
|
mockCompile,
|
||||||
mockDocument,
|
mockDocument,
|
||||||
@ -169,7 +159,7 @@ define(
|
|||||||
// Menu should have been removed
|
// Menu should have been removed
|
||||||
expect(mockMenu.remove).toHaveBeenCalled();
|
expect(mockMenu.remove).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps a menu when menu is clicked", function () {
|
it("keeps a menu when menu is clicked", function () {
|
||||||
// Show the menu
|
// Show the menu
|
||||||
action.perform();
|
action.perform();
|
||||||
@ -186,7 +176,7 @@ define(
|
|||||||
// Listener should have been detached from body
|
// Listener should have been detached from body
|
||||||
expect(mockBody.off).not.toHaveBeenCalled();
|
expect(mockBody.off).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps a menu when menu is clicked on mobile", function () {
|
it("keeps a menu when menu is clicked on mobile", function () {
|
||||||
mockAgentService.isMobile.andReturn(true);
|
mockAgentService.isMobile.andReturn(true);
|
||||||
action = new ContextMenuAction(
|
action = new ContextMenuAction(
|
||||||
@ -198,7 +188,7 @@ define(
|
|||||||
mockActionContext
|
mockActionContext
|
||||||
);
|
);
|
||||||
action.perform();
|
action.perform();
|
||||||
|
|
||||||
mockMenu.on.calls.forEach(function (call) {
|
mockMenu.on.calls.forEach(function (call) {
|
||||||
if (call.args[0] === 'touchstart') {
|
if (call.args[0] === 'touchstart') {
|
||||||
call.args[1](mockEvent);
|
call.args[1](mockEvent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user