mirror of
https://github.com/nasa/openmct.git
synced 2025-02-13 06:07:12 +00:00
[Build] Remove unused variables from specs
...to satisfy JSHint.
This commit is contained in:
parent
e470451718
commit
d6ec7e9ab8
@ -147,8 +147,7 @@ define(
|
||||
});
|
||||
|
||||
it("adds new objects to the parent's composition", function () {
|
||||
var model = { someKey: "some value" },
|
||||
parentModel = { composition: ["notAnyUUID"] };
|
||||
var model = { someKey: "some value" };
|
||||
creationService.createObject(model, mockParentObject);
|
||||
|
||||
// Verify that a new ID was added
|
||||
@ -199,8 +198,7 @@ define(
|
||||
it("logs an error when mutaton fails", function () {
|
||||
// If mutation of the parent fails, we've lost the
|
||||
// created object - this is an error.
|
||||
var model = { someKey: "some value" },
|
||||
parentModel = { composition: ["notAnyUUID"] };
|
||||
var model = { someKey: "some value" };
|
||||
|
||||
mockCompositionCapability.add.andReturn(mockPromise(false));
|
||||
|
||||
|
@ -30,7 +30,6 @@ define(
|
||||
describe("The navigate action", function () {
|
||||
var mockNavigationService,
|
||||
mockQ,
|
||||
actionContext,
|
||||
mockDomainObject,
|
||||
action;
|
||||
|
||||
|
@ -28,7 +28,6 @@ define(
|
||||
var actionSelected,
|
||||
actionCurrent,
|
||||
mockWindow,
|
||||
mockDomainObject,
|
||||
mockContextCurrent,
|
||||
mockContextSelected,
|
||||
mockUrlService;
|
||||
|
@ -26,7 +26,7 @@ define(
|
||||
|
||||
describe("Properties dialog", function () {
|
||||
|
||||
var type, properties, domainObject, model, dialog;
|
||||
var type, properties, model, dialog;
|
||||
|
||||
beforeEach(function () {
|
||||
type = {
|
||||
|
@ -93,8 +93,7 @@ define(
|
||||
});
|
||||
|
||||
it("exposes a warning message for unload", function () {
|
||||
var obj = mockObject,
|
||||
errorMessage = "Unsaved changes";
|
||||
var errorMessage = "Unsaved changes";
|
||||
|
||||
// Normally, should be undefined
|
||||
expect(controller.getUnloadWarning()).toBeUndefined();
|
||||
|
@ -28,7 +28,6 @@ define(
|
||||
|
||||
var captured,
|
||||
completionCapability,
|
||||
object,
|
||||
mockQ,
|
||||
mockType,
|
||||
cache;
|
||||
@ -45,7 +44,7 @@ define(
|
||||
type: mockType
|
||||
}[key];
|
||||
},
|
||||
hasCapability: function (key) {
|
||||
hasCapability: function () {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -25,7 +25,11 @@ define(
|
||||
function (EditableDomainObject) {
|
||||
|
||||
describe("Editable domain object", function () {
|
||||
var object;
|
||||
|
||||
beforeEach(function () {
|
||||
object = new EditableDomainObject();
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
@ -25,8 +25,7 @@ define(
|
||||
function (EditableViewPolicy) {
|
||||
|
||||
describe("The editable view policy", function () {
|
||||
var testView,
|
||||
mockDomainObject,
|
||||
var mockDomainObject,
|
||||
testMode,
|
||||
policy;
|
||||
|
||||
|
@ -147,7 +147,7 @@ define(
|
||||
});
|
||||
|
||||
it("invokes setters on update", function () {
|
||||
var structure, state;
|
||||
var structure;
|
||||
|
||||
testABC.a = jasmine.createSpy('a');
|
||||
|
||||
|
@ -28,7 +28,6 @@ define(
|
||||
|
||||
describe("The FormatProvider", function () {
|
||||
var mockFormats,
|
||||
mockLog,
|
||||
mockFormatInstances,
|
||||
provider;
|
||||
|
||||
|
@ -40,14 +40,6 @@ define(
|
||||
testRect,
|
||||
mctPopup;
|
||||
|
||||
function testEvent(x, y) {
|
||||
return {
|
||||
pageX: x,
|
||||
pageY: y,
|
||||
preventDefault: jasmine.createSpy("preventDefault")
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
mockCompile =
|
||||
jasmine.createSpy("$compile");
|
||||
|
@ -21,8 +21,8 @@
|
||||
*****************************************************************************/
|
||||
|
||||
define(
|
||||
['../../src/services/InfoService', '../../src/InfoConstants'],
|
||||
function (InfoService, InfoConstants) {
|
||||
['../../src/services/InfoService'],
|
||||
function (InfoService) {
|
||||
|
||||
describe("The info service", function () {
|
||||
var mockCompile,
|
||||
|
@ -27,7 +27,8 @@ define(
|
||||
describe("The notification indicator controller ", function () {
|
||||
var mockNotificationService,
|
||||
mockScope,
|
||||
mockDialogService;
|
||||
mockDialogService,
|
||||
controller;
|
||||
|
||||
beforeEach(function(){
|
||||
mockNotificationService = jasmine.createSpy("notificationService");
|
||||
@ -36,19 +37,18 @@ define(
|
||||
"dialogService",
|
||||
["getDialogResponse","dismiss"]
|
||||
);
|
||||
});
|
||||
|
||||
it("exposes the highest notification severity to the template", function() {
|
||||
mockNotificationService.highest = {
|
||||
severity: "error"
|
||||
};
|
||||
var controller = new NotificationIndicatorController(mockScope, mockNotificationService, mockDialogService);
|
||||
controller = new NotificationIndicatorController(mockScope, mockNotificationService, mockDialogService);
|
||||
});
|
||||
|
||||
it("exposes the highest notification severity to the template", function() {
|
||||
expect(mockScope.highest).toBeTruthy();
|
||||
expect(mockScope.highest.severity).toBe("error");
|
||||
});
|
||||
|
||||
it("invokes the dialog service to show list of messages", function() {
|
||||
var controller = new NotificationIndicatorController(mockScope, mockNotificationService, mockDialogService);
|
||||
expect(mockScope.showNotificationsList).toBeDefined();
|
||||
mockScope.showNotificationsList();
|
||||
expect(mockDialogService.getDialogResponse).toHaveBeenCalled();
|
||||
@ -61,7 +61,6 @@ define(
|
||||
});
|
||||
|
||||
it("provides a means of dismissing the message list", function() {
|
||||
var controller = new NotificationIndicatorController(mockScope, mockNotificationService, mockDialogService);
|
||||
expect(mockScope.showNotificationsList).toBeDefined();
|
||||
mockScope.showNotificationsList();
|
||||
expect(mockDialogService.getDialogResponse).toHaveBeenCalled();
|
||||
|
@ -39,7 +39,7 @@ define(
|
||||
[ 'getCapabilities' ]
|
||||
);
|
||||
// Both types can only contain b, let's say
|
||||
mockTypes = ['a', 'b'].map(function (type, index) {
|
||||
mockTypes = ['a', 'b'].map(function (type) {
|
||||
var mockType = jasmine.createSpyObj(
|
||||
'type-' + type,
|
||||
['getKey', 'getDefinition', 'getInitialModel']
|
||||
|
@ -60,7 +60,7 @@ define(
|
||||
});
|
||||
|
||||
it("allows setting a model", function () {
|
||||
mutation.invoke(function (m) {
|
||||
mutation.invoke(function () {
|
||||
return { someKey: "some value" };
|
||||
});
|
||||
expect(testModel.number).toBeUndefined();
|
||||
|
@ -104,10 +104,8 @@ define(
|
||||
});
|
||||
|
||||
it("avoids redundant requests", function () {
|
||||
// Lookups can be expensive, so this capability
|
||||
// Lookups can be expensive, so this capability
|
||||
// should have some self-caching
|
||||
var response;
|
||||
|
||||
mockDomainObject.getModel
|
||||
.andReturn({ relationships: { xyz: ['a'] } });
|
||||
|
||||
@ -123,7 +121,7 @@ define(
|
||||
it("makes new requests on modification", function () {
|
||||
// Lookups can be expensive, so this capability
|
||||
// should have some self-caching
|
||||
var response, testModel;
|
||||
var testModel;
|
||||
|
||||
testModel = { relationships: { xyz: ['a'] } };
|
||||
|
||||
|
@ -34,7 +34,7 @@ define(
|
||||
});
|
||||
|
||||
describe("when space is encoded", function () {
|
||||
var idSpace, idKey, spacedId;
|
||||
var idSpace, idKey;
|
||||
|
||||
beforeEach(function () {
|
||||
idSpace = "a-specific-space";
|
||||
|
@ -46,12 +46,6 @@ define(
|
||||
};
|
||||
}
|
||||
|
||||
function mockAll(mockPromises) {
|
||||
return mockPromise(mockPromises.map(function (p) {
|
||||
return mockPromise(p).testValue;
|
||||
}));
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
mockModelService = jasmine.createSpyObj(
|
||||
"modelService",
|
||||
|
@ -30,8 +30,6 @@ define(
|
||||
mockIdentifierService,
|
||||
mockCapabilityConstructor,
|
||||
mockCapabilityInstance,
|
||||
mockCapabilities,
|
||||
mockIdentifier,
|
||||
idCounter,
|
||||
testModel,
|
||||
instantiate,
|
||||
|
@ -26,13 +26,7 @@ define(
|
||||
|
||||
describe("Type provider", function () {
|
||||
|
||||
var captured = {},
|
||||
capture = function (name) {
|
||||
return function (value) {
|
||||
captured[name] = value;
|
||||
};
|
||||
},
|
||||
testTypeDefinitions = [
|
||||
var testTypeDefinitions = [
|
||||
{
|
||||
key: 'basic',
|
||||
glyph: "X",
|
||||
|
@ -133,8 +133,7 @@ define(
|
||||
});
|
||||
|
||||
it("enforces view restrictions from types", function () {
|
||||
var testType = "testType",
|
||||
testView = { key: "x" },
|
||||
var testView = { key: "x" },
|
||||
provider = new ViewProvider([testView], mockLog);
|
||||
|
||||
// Include a "type" capability
|
||||
|
@ -32,8 +32,7 @@ define(
|
||||
var testContext,
|
||||
testModel,
|
||||
testId,
|
||||
mockLocationCapability,
|
||||
mockContextCapability;
|
||||
mockLocationCapability;
|
||||
|
||||
beforeEach(function () {
|
||||
testId = "some-id";
|
||||
|
@ -124,10 +124,8 @@ define(
|
||||
|
||||
var mockQ,
|
||||
mockDeferred,
|
||||
creationService,
|
||||
createObjectPromise,
|
||||
copyService,
|
||||
mockNow,
|
||||
object,
|
||||
newParent,
|
||||
copyResult,
|
||||
@ -172,7 +170,7 @@ define(
|
||||
'mockDeferred',
|
||||
['notify', 'resolve', 'reject']
|
||||
);
|
||||
mockDeferred.notify.andCallFake(function(notification){});
|
||||
mockDeferred.notify.andCallFake(function(){});
|
||||
mockDeferred.resolve.andCallFake(function(value){resolvedValue = value;});
|
||||
mockDeferred.promise = {
|
||||
then: function(callback){
|
||||
@ -271,8 +269,7 @@ define(
|
||||
});
|
||||
|
||||
describe("on domainObject with composition", function () {
|
||||
var newObject,
|
||||
childObject,
|
||||
var childObject,
|
||||
objectClone,
|
||||
childObjectClone,
|
||||
compositionPromise;
|
||||
|
@ -187,8 +187,7 @@ define(
|
||||
|
||||
describe("copies object trees with multiple references to the" +
|
||||
" same object", function () {
|
||||
var model,
|
||||
mockDomainObjectB,
|
||||
var mockDomainObjectB,
|
||||
mockComposingObject,
|
||||
composingObjectModel,
|
||||
domainObjectClone,
|
||||
@ -252,9 +251,7 @@ define(
|
||||
it(" and correctly updates child identifiers in object" +
|
||||
" arrays within models ", function () {
|
||||
var childA_ID = task.clones[0].getId(),
|
||||
childB_ID = task.clones[1].getId(),
|
||||
childC_ID = task.clones[3].getId(),
|
||||
childD_ID = task.clones[4].getId();
|
||||
childB_ID = task.clones[1].getId();
|
||||
|
||||
expect(domainObjectClone.model.objArr[0].id).not.toBe(ID_A);
|
||||
expect(domainObjectClone.model.objArr[0].id).toBe(childA_ID);
|
||||
|
@ -31,7 +31,6 @@ define(
|
||||
var mockScope,
|
||||
mockTicker,
|
||||
mockUnticker,
|
||||
mockDomainObject,
|
||||
controller;
|
||||
|
||||
beforeEach(function () {
|
||||
|
@ -45,10 +45,6 @@ define(
|
||||
].reduce(sum, 0);
|
||||
}
|
||||
|
||||
function twoDigits(n) {
|
||||
return n < 10 ? ('0' + n) : n;
|
||||
}
|
||||
|
||||
it("formats short-form values (no days)", function () {
|
||||
expect(formatter.short(toDuration(0, 123, 2, 3) + 123))
|
||||
.toEqual("123:02:03");
|
||||
|
@ -33,16 +33,6 @@ define(
|
||||
mockSeries,
|
||||
decorator;
|
||||
|
||||
function seriesIsInWindow(series) {
|
||||
var i, v, inWindow = true;
|
||||
for (i = 0; i < series.getPointCount(); i += 1) {
|
||||
v = series.getDomainValue(i);
|
||||
inWindow = inWindow && (v >= mockConductor.displayStart());
|
||||
inWindow = inWindow && (v <= mockConductor.displayEnd());
|
||||
}
|
||||
return inWindow;
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
mockTelemetryService = jasmine.createSpyObj(
|
||||
'telemetryService',
|
||||
|
@ -30,7 +30,6 @@ define(
|
||||
describe("The messages view policy", function () {
|
||||
var mockDomainObject,
|
||||
mockTelemetry,
|
||||
telemetryType,
|
||||
testType,
|
||||
testView,
|
||||
testMetadata,
|
||||
@ -50,7 +49,7 @@ define(
|
||||
['getMetadata']
|
||||
);
|
||||
|
||||
mockDomainObject.getModel.andCallFake(function (c) {
|
||||
mockDomainObject.getModel.andCallFake(function () {
|
||||
return {type: testType};
|
||||
});
|
||||
mockDomainObject.getCapability.andCallFake(function (c) {
|
||||
|
@ -235,7 +235,7 @@ define(
|
||||
});
|
||||
|
||||
it("ensures a minimum frame size", function () {
|
||||
var styleB, styleC;
|
||||
var styleB;
|
||||
|
||||
// Start with a very small frame size
|
||||
testModel.layoutGrid = [ 1, 1 ];
|
||||
|
@ -32,7 +32,6 @@ define(
|
||||
mockCompositionCapability,
|
||||
mockComposition,
|
||||
mockUnlisten,
|
||||
mockFormUnlisten,
|
||||
mockChildOne,
|
||||
mockChildTwo,
|
||||
model,
|
||||
|
@ -25,8 +25,7 @@ define(
|
||||
function (PlotOptionsForm) {
|
||||
|
||||
describe("The Plot Options form", function () {
|
||||
var plotOptionsForm,
|
||||
listener;
|
||||
var plotOptionsForm;
|
||||
|
||||
beforeEach(function () {
|
||||
|
||||
|
@ -29,7 +29,6 @@ define(
|
||||
testRange,
|
||||
mockTelemetryObjects,
|
||||
testData,
|
||||
mockLimitCapabilities,
|
||||
tracker;
|
||||
|
||||
beforeEach(function () {
|
||||
|
@ -61,6 +61,8 @@ define(
|
||||
var datas = [makeMockData(1)],
|
||||
preparer = new PlotPreparer(datas, "testDomain", "testRange");
|
||||
|
||||
expect(preparer).toBeDefined();
|
||||
|
||||
expect(datas[0].getDomainValue).toHaveBeenCalledWith(
|
||||
jasmine.any(Number),
|
||||
"testDomain"
|
||||
|
@ -30,20 +30,11 @@ define(
|
||||
describe("Overlaid plot mode", function () {
|
||||
var mockDomainObject,
|
||||
mockSubPlotFactory,
|
||||
mockSubPlot,
|
||||
mockPrepared,
|
||||
testBuffers,
|
||||
testDrawingObjects,
|
||||
mode;
|
||||
|
||||
function mockElement(x, y, w, h) {
|
||||
return {
|
||||
getBoundingClientRect: function () {
|
||||
return { left: x, top: y, width: w, height: h };
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function createMockSubPlot() {
|
||||
var mockSubPlot = jasmine.createSpyObj(
|
||||
"subPlot",
|
||||
@ -127,7 +118,7 @@ define(
|
||||
mode.plotTelemetry(mockPrepared);
|
||||
|
||||
// Should have one sub-plot with three lines
|
||||
testDrawingObjects.forEach(function (testDrawingObject, i) {
|
||||
testDrawingObjects.forEach(function (testDrawingObject) {
|
||||
// Either empty list or undefined is fine;
|
||||
// just want to make sure there are no lines.
|
||||
expect(testDrawingObject.lines.length)
|
||||
@ -178,7 +169,7 @@ define(
|
||||
});
|
||||
|
||||
// Step back the same number of zoom changes
|
||||
mockSubPlotFactory.createSubPlot.calls.forEach(function (c) {
|
||||
mockSubPlotFactory.createSubPlot.calls.forEach(function () {
|
||||
// Should still be zoomed at start of each iteration
|
||||
expect(mode.isZoomed()).toBeTruthy();
|
||||
// Step back one of the zoom changes.
|
||||
|
@ -30,20 +30,11 @@ define(
|
||||
describe("Stacked plot mode", function () {
|
||||
var mockDomainObject,
|
||||
mockSubPlotFactory,
|
||||
mockSubPlot,
|
||||
mockPrepared,
|
||||
testBuffers,
|
||||
testDrawingObjects,
|
||||
mode;
|
||||
|
||||
function mockElement(x, y, w, h) {
|
||||
return {
|
||||
getBoundingClientRect: function () {
|
||||
return { left: x, top: y, width: w, height: h };
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function createMockSubPlot() {
|
||||
var mockSubPlot = jasmine.createSpyObj(
|
||||
"subPlot",
|
||||
@ -172,7 +163,7 @@ define(
|
||||
});
|
||||
|
||||
// Step back the same number of zoom changes
|
||||
mockSubPlotFactory.createSubPlot.calls.forEach(function (c) {
|
||||
mockSubPlotFactory.createSubPlot.calls.forEach(function () {
|
||||
// Should still be zoomed at start of each iteration
|
||||
expect(mode.isZoomed()).toBeTruthy();
|
||||
// Step back
|
||||
|
@ -34,14 +34,6 @@ define(
|
||||
mockTimeout,
|
||||
mockElement;
|
||||
|
||||
function promise(value) {
|
||||
return {
|
||||
then: function (callback){
|
||||
return promise(callback(value));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(function() {
|
||||
watches = {};
|
||||
|
||||
|
@ -32,14 +32,6 @@ define(
|
||||
controller,
|
||||
mockScope;
|
||||
|
||||
function promise(value) {
|
||||
return {
|
||||
then: function (callback){
|
||||
return promise(callback(value));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(function() {
|
||||
mockCapability = jasmine.createSpyObj('mutationCapability', [
|
||||
'listen'
|
||||
|
@ -130,8 +130,6 @@ define(
|
||||
|
||||
it('to create column configuration, which is written to the' +
|
||||
' object model', function() {
|
||||
var mockModel = {};
|
||||
|
||||
controller.setup();
|
||||
expect(mockTable.getColumnConfiguration).toHaveBeenCalled();
|
||||
expect(mockTable.saveColumnConfiguration).toHaveBeenCalled();
|
||||
|
@ -33,7 +33,6 @@ define(
|
||||
mockElement,
|
||||
testAttrs,
|
||||
mockSwimlane,
|
||||
mockRealElement,
|
||||
testEvent,
|
||||
handlers,
|
||||
directive;
|
||||
|
@ -29,8 +29,7 @@ define(
|
||||
mctForm;
|
||||
|
||||
function installController() {
|
||||
var controllerProperty = mctForm.controller,
|
||||
Controller = mctForm.controller[1];
|
||||
var Controller = mctForm.controller[1];
|
||||
return new Controller(mockScope);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,6 @@ define(
|
||||
var mockProviders,
|
||||
mockQ,
|
||||
resolves,
|
||||
mockPromise,
|
||||
mockCallback,
|
||||
testUsers,
|
||||
aggregator;
|
||||
|
@ -104,7 +104,7 @@ define(
|
||||
// User chooses overwrite
|
||||
mockPromise.then.mostRecentCall.args[0](false);
|
||||
// Should refresh, but not remutate, and requeue all objects
|
||||
mockFailures.forEach(function (mockFailure, i) {
|
||||
mockFailures.forEach(function (mockFailure) {
|
||||
expect(mockFailure.persistence.refresh).toHaveBeenCalled();
|
||||
expect(mockFailure.requeue).not.toHaveBeenCalled();
|
||||
expect(mockFailure.domainObject.useCapability).not.toHaveBeenCalled();
|
||||
|
@ -86,7 +86,7 @@ define(
|
||||
|
||||
it("filters out policy-disallowed actions", function () {
|
||||
// Disallow the second action
|
||||
mockPolicyService.allow.andCallFake(function (cat, candidate, ctxt) {
|
||||
mockPolicyService.allow.andCallFake(function (cat, candidate) {
|
||||
return candidate.someKey !== 'b';
|
||||
});
|
||||
expect(decorator.getActions(testContext))
|
||||
|
@ -90,7 +90,7 @@ define(
|
||||
|
||||
it("filters out policy-disallowed views", function () {
|
||||
// Disallow the second action
|
||||
mockPolicyService.allow.andCallFake(function (cat, candidate, ctxt) {
|
||||
mockPolicyService.allow.andCallFake(function (cat, candidate) {
|
||||
return candidate.someKey !== 'b';
|
||||
});
|
||||
expect(decorator.getViews(mockDomainObject))
|
||||
|
@ -25,12 +25,11 @@
|
||||
* Module defining ContextMenuActionSpec. Created by shale on 07/02/2015.
|
||||
*/
|
||||
define(
|
||||
["../../src/actions/ContextMenuAction", "../../src/gestures/GestureConstants"],
|
||||
function (ContextMenuAction, GestureConstants) {
|
||||
["../../src/actions/ContextMenuAction"],
|
||||
function (ContextMenuAction) {
|
||||
|
||||
var JQLITE_FUNCTIONS = [ "on", "off", "find", "append", "remove" ],
|
||||
DOMAIN_OBJECT_METHODS = [ "getId", "getModel", "getCapability", "hasCapability", "useCapability" ],
|
||||
MENU_DIMENSIONS = GestureConstants.MCT_MENU_DIMENSIONS;
|
||||
DOMAIN_OBJECT_METHODS = [ "getId", "getModel", "getCapability", "hasCapability", "useCapability" ];
|
||||
|
||||
|
||||
describe("The 'context menu' action", function () {
|
||||
|
@ -27,7 +27,6 @@ define(
|
||||
describe("A gesture representer", function () {
|
||||
var mockGestureService,
|
||||
mockGestureHandle,
|
||||
mockScope,
|
||||
mockElement,
|
||||
representer;
|
||||
|
||||
|
@ -29,7 +29,6 @@ define(
|
||||
|
||||
describe("The search menu controller", function () {
|
||||
var mockScope,
|
||||
mockPromise,
|
||||
mockTypes,
|
||||
controller;
|
||||
|
||||
|
@ -25,7 +25,11 @@ define(
|
||||
function (TelemetryDelegator) {
|
||||
|
||||
describe("The telemetry delegator", function () {
|
||||
var delegator;
|
||||
|
||||
beforeEach(function () {
|
||||
delegator = new TelemetryDelegator();
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user