From d6ec7e9ab883d125f995c176e48f753fd98de145 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 4 Mar 2016 12:56:14 -0800 Subject: [PATCH] [Build] Remove unused variables from specs ...to satisfy JSHint. --- .../browse/test/creation/CreationServiceSpec.js | 6 ++---- .../browse/test/navigation/NavigateActionSpec.js | 1 - .../browse/test/windowing/NewTabActionSpec.js | 1 - .../edit/test/actions/PropertiesDialogSpec.js | 2 +- .../edit/test/controllers/EditControllerSpec.js | 3 +-- .../test/objects/EditableDomainObjectCacheSpec.js | 3 +-- .../edit/test/objects/EditableDomainObjectSpec.js | 4 ++++ .../edit/test/policies/EditableViewPolicySpec.js | 3 +-- .../edit/test/representers/EditToolbarSpec.js | 2 +- .../commonUI/formats/test/FormatProviderSpec.js | 1 - .../general/test/directives/MCTPopupSpec.js | 8 -------- .../inspect/test/services/InfoServiceSpec.js | 4 ++-- .../test/NotificationIndicatorControllerSpec.js | 13 ++++++------- platform/containment/test/CapabilityTableSpec.js | 2 +- .../test/capabilities/MutationCapabilitySpec.js | 2 +- .../test/capabilities/RelationshipCapabilitySpec.js | 6 ++---- platform/core/test/identifiers/IdentifierSpec.js | 2 +- .../core/test/objects/DomainObjectProviderSpec.js | 6 ------ platform/core/test/services/InstantiateSpec.js | 2 -- platform/core/test/types/TypeProviderSpec.js | 8 +------- platform/core/test/views/ViewProviderSpec.js | 3 +-- .../test/actions/SetPrimaryLocationActionSpec.js | 3 +-- .../entanglement/test/services/CopyServiceSpec.js | 7 ++----- platform/entanglement/test/services/CopyTaskSpec.js | 7 ++----- .../clock/test/controllers/ClockControllerSpec.js | 1 - .../clock/test/controllers/TimerFormatterSpec.js | 4 ---- .../test/ConductorTelemetryDecoratorSpec.js | 10 ---------- .../events/test/policies/MessagesViewPolicySpec.js | 3 +-- .../features/layout/test/LayoutControllerSpec.js | 2 +- .../features/plot/test/PlotOptionsControllerSpec.js | 1 - platform/features/plot/test/PlotOptionsFormSpec.js | 3 +-- .../plot/test/elements/PlotLimitTrackerSpec.js | 1 - .../features/plot/test/elements/PlotPreparerSpec.js | 2 ++ .../features/plot/test/modes/PlotOverlayModeSpec.js | 13 ++----------- .../features/plot/test/modes/PlotStackModeSpec.js | 11 +---------- .../test/controllers/MCTTableControllerSpec.js | 8 -------- .../test/controllers/TableOptionsControllerSpec.js | 8 -------- .../controllers/TelemetryTableControllerSpec.js | 2 -- .../timeline/test/directives/MCTSwimlaneDropSpec.js | 1 - platform/forms/test/MCTFormSpec.js | 3 +-- platform/identity/test/IdentityAggregatorSpec.js | 1 - .../queue/test/PersistenceFailureHandlerSpec.js | 2 +- platform/policy/test/PolicyActionDecoratorSpec.js | 2 +- platform/policy/test/PolicyViewDecoratorSpec.js | 2 +- .../test/actions/ContextMenuActionSpec.js | 7 +++---- .../test/gestures/GestureRepresenterSpec.js | 1 - .../test/controllers/SearchMenuControllerSpec.js | 1 - platform/telemetry/test/TelemetryDelegatorSpec.js | 4 ++++ 48 files changed, 50 insertions(+), 142 deletions(-) diff --git a/platform/commonUI/browse/test/creation/CreationServiceSpec.js b/platform/commonUI/browse/test/creation/CreationServiceSpec.js index deb2ba068b..270f5f8c90 100644 --- a/platform/commonUI/browse/test/creation/CreationServiceSpec.js +++ b/platform/commonUI/browse/test/creation/CreationServiceSpec.js @@ -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)); diff --git a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js index fca6f3bea0..0295651a1f 100644 --- a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js +++ b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js @@ -30,7 +30,6 @@ define( describe("The navigate action", function () { var mockNavigationService, mockQ, - actionContext, mockDomainObject, action; diff --git a/platform/commonUI/browse/test/windowing/NewTabActionSpec.js b/platform/commonUI/browse/test/windowing/NewTabActionSpec.js index 47f02f6c41..335c4fe42b 100644 --- a/platform/commonUI/browse/test/windowing/NewTabActionSpec.js +++ b/platform/commonUI/browse/test/windowing/NewTabActionSpec.js @@ -28,7 +28,6 @@ define( var actionSelected, actionCurrent, mockWindow, - mockDomainObject, mockContextCurrent, mockContextSelected, mockUrlService; diff --git a/platform/commonUI/edit/test/actions/PropertiesDialogSpec.js b/platform/commonUI/edit/test/actions/PropertiesDialogSpec.js index 764d8483c9..2de6c12885 100644 --- a/platform/commonUI/edit/test/actions/PropertiesDialogSpec.js +++ b/platform/commonUI/edit/test/actions/PropertiesDialogSpec.js @@ -26,7 +26,7 @@ define( describe("Properties dialog", function () { - var type, properties, domainObject, model, dialog; + var type, properties, model, dialog; beforeEach(function () { type = { diff --git a/platform/commonUI/edit/test/controllers/EditControllerSpec.js b/platform/commonUI/edit/test/controllers/EditControllerSpec.js index a359d6945b..8c6a1ee31f 100644 --- a/platform/commonUI/edit/test/controllers/EditControllerSpec.js +++ b/platform/commonUI/edit/test/controllers/EditControllerSpec.js @@ -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(); diff --git a/platform/commonUI/edit/test/objects/EditableDomainObjectCacheSpec.js b/platform/commonUI/edit/test/objects/EditableDomainObjectCacheSpec.js index 127bf6e3e4..edbfd3edc4 100644 --- a/platform/commonUI/edit/test/objects/EditableDomainObjectCacheSpec.js +++ b/platform/commonUI/edit/test/objects/EditableDomainObjectCacheSpec.js @@ -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; } }; diff --git a/platform/commonUI/edit/test/objects/EditableDomainObjectSpec.js b/platform/commonUI/edit/test/objects/EditableDomainObjectSpec.js index 3878575237..9b1095f68d 100644 --- a/platform/commonUI/edit/test/objects/EditableDomainObjectSpec.js +++ b/platform/commonUI/edit/test/objects/EditableDomainObjectSpec.js @@ -25,7 +25,11 @@ define( function (EditableDomainObject) { describe("Editable domain object", function () { + var object; + beforeEach(function () { + object = new EditableDomainObject(); + }); }); } ); \ No newline at end of file diff --git a/platform/commonUI/edit/test/policies/EditableViewPolicySpec.js b/platform/commonUI/edit/test/policies/EditableViewPolicySpec.js index 6f432fafeb..2194a8c45a 100644 --- a/platform/commonUI/edit/test/policies/EditableViewPolicySpec.js +++ b/platform/commonUI/edit/test/policies/EditableViewPolicySpec.js @@ -25,8 +25,7 @@ define( function (EditableViewPolicy) { describe("The editable view policy", function () { - var testView, - mockDomainObject, + var mockDomainObject, testMode, policy; diff --git a/platform/commonUI/edit/test/representers/EditToolbarSpec.js b/platform/commonUI/edit/test/representers/EditToolbarSpec.js index 9a5488d356..a252b32612 100644 --- a/platform/commonUI/edit/test/representers/EditToolbarSpec.js +++ b/platform/commonUI/edit/test/representers/EditToolbarSpec.js @@ -147,7 +147,7 @@ define( }); it("invokes setters on update", function () { - var structure, state; + var structure; testABC.a = jasmine.createSpy('a'); diff --git a/platform/commonUI/formats/test/FormatProviderSpec.js b/platform/commonUI/formats/test/FormatProviderSpec.js index d66f9f8a5d..527a0182af 100644 --- a/platform/commonUI/formats/test/FormatProviderSpec.js +++ b/platform/commonUI/formats/test/FormatProviderSpec.js @@ -28,7 +28,6 @@ define( describe("The FormatProvider", function () { var mockFormats, - mockLog, mockFormatInstances, provider; diff --git a/platform/commonUI/general/test/directives/MCTPopupSpec.js b/platform/commonUI/general/test/directives/MCTPopupSpec.js index 065b916c32..bfe6b469cb 100644 --- a/platform/commonUI/general/test/directives/MCTPopupSpec.js +++ b/platform/commonUI/general/test/directives/MCTPopupSpec.js @@ -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"); diff --git a/platform/commonUI/inspect/test/services/InfoServiceSpec.js b/platform/commonUI/inspect/test/services/InfoServiceSpec.js index 167b940360..1f5c315041 100644 --- a/platform/commonUI/inspect/test/services/InfoServiceSpec.js +++ b/platform/commonUI/inspect/test/services/InfoServiceSpec.js @@ -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, diff --git a/platform/commonUI/notification/test/NotificationIndicatorControllerSpec.js b/platform/commonUI/notification/test/NotificationIndicatorControllerSpec.js index 0af266ad19..a6acd28417 100644 --- a/platform/commonUI/notification/test/NotificationIndicatorControllerSpec.js +++ b/platform/commonUI/notification/test/NotificationIndicatorControllerSpec.js @@ -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(); diff --git a/platform/containment/test/CapabilityTableSpec.js b/platform/containment/test/CapabilityTableSpec.js index 79a86d45d5..76fbd6ffcd 100644 --- a/platform/containment/test/CapabilityTableSpec.js +++ b/platform/containment/test/CapabilityTableSpec.js @@ -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'] diff --git a/platform/core/test/capabilities/MutationCapabilitySpec.js b/platform/core/test/capabilities/MutationCapabilitySpec.js index 28aa983144..bb6070b154 100644 --- a/platform/core/test/capabilities/MutationCapabilitySpec.js +++ b/platform/core/test/capabilities/MutationCapabilitySpec.js @@ -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(); diff --git a/platform/core/test/capabilities/RelationshipCapabilitySpec.js b/platform/core/test/capabilities/RelationshipCapabilitySpec.js index f3130326c6..6b69a9b615 100644 --- a/platform/core/test/capabilities/RelationshipCapabilitySpec.js +++ b/platform/core/test/capabilities/RelationshipCapabilitySpec.js @@ -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'] } }; diff --git a/platform/core/test/identifiers/IdentifierSpec.js b/platform/core/test/identifiers/IdentifierSpec.js index 37fee4b82a..e54a853712 100644 --- a/platform/core/test/identifiers/IdentifierSpec.js +++ b/platform/core/test/identifiers/IdentifierSpec.js @@ -34,7 +34,7 @@ define( }); describe("when space is encoded", function () { - var idSpace, idKey, spacedId; + var idSpace, idKey; beforeEach(function () { idSpace = "a-specific-space"; diff --git a/platform/core/test/objects/DomainObjectProviderSpec.js b/platform/core/test/objects/DomainObjectProviderSpec.js index 19aa95bc24..6da0d122b5 100644 --- a/platform/core/test/objects/DomainObjectProviderSpec.js +++ b/platform/core/test/objects/DomainObjectProviderSpec.js @@ -46,12 +46,6 @@ define( }; } - function mockAll(mockPromises) { - return mockPromise(mockPromises.map(function (p) { - return mockPromise(p).testValue; - })); - } - beforeEach(function () { mockModelService = jasmine.createSpyObj( "modelService", diff --git a/platform/core/test/services/InstantiateSpec.js b/platform/core/test/services/InstantiateSpec.js index bd609de8ef..0d32f9fa0e 100644 --- a/platform/core/test/services/InstantiateSpec.js +++ b/platform/core/test/services/InstantiateSpec.js @@ -30,8 +30,6 @@ define( mockIdentifierService, mockCapabilityConstructor, mockCapabilityInstance, - mockCapabilities, - mockIdentifier, idCounter, testModel, instantiate, diff --git a/platform/core/test/types/TypeProviderSpec.js b/platform/core/test/types/TypeProviderSpec.js index d178564e2e..3f687764d3 100644 --- a/platform/core/test/types/TypeProviderSpec.js +++ b/platform/core/test/types/TypeProviderSpec.js @@ -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", diff --git a/platform/core/test/views/ViewProviderSpec.js b/platform/core/test/views/ViewProviderSpec.js index 936bb903b4..0029527bbb 100644 --- a/platform/core/test/views/ViewProviderSpec.js +++ b/platform/core/test/views/ViewProviderSpec.js @@ -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 diff --git a/platform/entanglement/test/actions/SetPrimaryLocationActionSpec.js b/platform/entanglement/test/actions/SetPrimaryLocationActionSpec.js index db6e805a3e..ca4c1671ec 100644 --- a/platform/entanglement/test/actions/SetPrimaryLocationActionSpec.js +++ b/platform/entanglement/test/actions/SetPrimaryLocationActionSpec.js @@ -32,8 +32,7 @@ define( var testContext, testModel, testId, - mockLocationCapability, - mockContextCapability; + mockLocationCapability; beforeEach(function () { testId = "some-id"; diff --git a/platform/entanglement/test/services/CopyServiceSpec.js b/platform/entanglement/test/services/CopyServiceSpec.js index e020a828b3..c036de1ec6 100644 --- a/platform/entanglement/test/services/CopyServiceSpec.js +++ b/platform/entanglement/test/services/CopyServiceSpec.js @@ -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; diff --git a/platform/entanglement/test/services/CopyTaskSpec.js b/platform/entanglement/test/services/CopyTaskSpec.js index 6f97db7fe0..32302edb04 100644 --- a/platform/entanglement/test/services/CopyTaskSpec.js +++ b/platform/entanglement/test/services/CopyTaskSpec.js @@ -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); diff --git a/platform/features/clock/test/controllers/ClockControllerSpec.js b/platform/features/clock/test/controllers/ClockControllerSpec.js index c453ca356d..3ee76596fb 100644 --- a/platform/features/clock/test/controllers/ClockControllerSpec.js +++ b/platform/features/clock/test/controllers/ClockControllerSpec.js @@ -31,7 +31,6 @@ define( var mockScope, mockTicker, mockUnticker, - mockDomainObject, controller; beforeEach(function () { diff --git a/platform/features/clock/test/controllers/TimerFormatterSpec.js b/platform/features/clock/test/controllers/TimerFormatterSpec.js index 9a54685f21..58f91edad7 100644 --- a/platform/features/clock/test/controllers/TimerFormatterSpec.js +++ b/platform/features/clock/test/controllers/TimerFormatterSpec.js @@ -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"); diff --git a/platform/features/conductor/test/ConductorTelemetryDecoratorSpec.js b/platform/features/conductor/test/ConductorTelemetryDecoratorSpec.js index 914fbf0e3b..aa7757423b 100644 --- a/platform/features/conductor/test/ConductorTelemetryDecoratorSpec.js +++ b/platform/features/conductor/test/ConductorTelemetryDecoratorSpec.js @@ -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', diff --git a/platform/features/events/test/policies/MessagesViewPolicySpec.js b/platform/features/events/test/policies/MessagesViewPolicySpec.js index 95542fa2c3..f890dda91a 100644 --- a/platform/features/events/test/policies/MessagesViewPolicySpec.js +++ b/platform/features/events/test/policies/MessagesViewPolicySpec.js @@ -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) { diff --git a/platform/features/layout/test/LayoutControllerSpec.js b/platform/features/layout/test/LayoutControllerSpec.js index 85efaec5bd..ebd778cb7e 100644 --- a/platform/features/layout/test/LayoutControllerSpec.js +++ b/platform/features/layout/test/LayoutControllerSpec.js @@ -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 ]; diff --git a/platform/features/plot/test/PlotOptionsControllerSpec.js b/platform/features/plot/test/PlotOptionsControllerSpec.js index 6584ccfe78..caaf66182a 100644 --- a/platform/features/plot/test/PlotOptionsControllerSpec.js +++ b/platform/features/plot/test/PlotOptionsControllerSpec.js @@ -32,7 +32,6 @@ define( mockCompositionCapability, mockComposition, mockUnlisten, - mockFormUnlisten, mockChildOne, mockChildTwo, model, diff --git a/platform/features/plot/test/PlotOptionsFormSpec.js b/platform/features/plot/test/PlotOptionsFormSpec.js index 6ee5a25ac6..bb35d532f4 100644 --- a/platform/features/plot/test/PlotOptionsFormSpec.js +++ b/platform/features/plot/test/PlotOptionsFormSpec.js @@ -25,8 +25,7 @@ define( function (PlotOptionsForm) { describe("The Plot Options form", function () { - var plotOptionsForm, - listener; + var plotOptionsForm; beforeEach(function () { diff --git a/platform/features/plot/test/elements/PlotLimitTrackerSpec.js b/platform/features/plot/test/elements/PlotLimitTrackerSpec.js index 3e080b9e87..d37507c628 100644 --- a/platform/features/plot/test/elements/PlotLimitTrackerSpec.js +++ b/platform/features/plot/test/elements/PlotLimitTrackerSpec.js @@ -29,7 +29,6 @@ define( testRange, mockTelemetryObjects, testData, - mockLimitCapabilities, tracker; beforeEach(function () { diff --git a/platform/features/plot/test/elements/PlotPreparerSpec.js b/platform/features/plot/test/elements/PlotPreparerSpec.js index fd0535bd91..414c3b56e1 100644 --- a/platform/features/plot/test/elements/PlotPreparerSpec.js +++ b/platform/features/plot/test/elements/PlotPreparerSpec.js @@ -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" diff --git a/platform/features/plot/test/modes/PlotOverlayModeSpec.js b/platform/features/plot/test/modes/PlotOverlayModeSpec.js index 2f86c0e11e..0560d428f7 100644 --- a/platform/features/plot/test/modes/PlotOverlayModeSpec.js +++ b/platform/features/plot/test/modes/PlotOverlayModeSpec.js @@ -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. diff --git a/platform/features/plot/test/modes/PlotStackModeSpec.js b/platform/features/plot/test/modes/PlotStackModeSpec.js index db052dbe5c..cf4407e7e0 100644 --- a/platform/features/plot/test/modes/PlotStackModeSpec.js +++ b/platform/features/plot/test/modes/PlotStackModeSpec.js @@ -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 diff --git a/platform/features/table/test/controllers/MCTTableControllerSpec.js b/platform/features/table/test/controllers/MCTTableControllerSpec.js index f9c7ff50c7..4fe4be7df3 100644 --- a/platform/features/table/test/controllers/MCTTableControllerSpec.js +++ b/platform/features/table/test/controllers/MCTTableControllerSpec.js @@ -34,14 +34,6 @@ define( mockTimeout, mockElement; - function promise(value) { - return { - then: function (callback){ - return promise(callback(value)); - } - }; - } - beforeEach(function() { watches = {}; diff --git a/platform/features/table/test/controllers/TableOptionsControllerSpec.js b/platform/features/table/test/controllers/TableOptionsControllerSpec.js index 7976aecafd..4838f2e6ac 100644 --- a/platform/features/table/test/controllers/TableOptionsControllerSpec.js +++ b/platform/features/table/test/controllers/TableOptionsControllerSpec.js @@ -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' diff --git a/platform/features/table/test/controllers/TelemetryTableControllerSpec.js b/platform/features/table/test/controllers/TelemetryTableControllerSpec.js index 548e0ea733..91e6a05315 100644 --- a/platform/features/table/test/controllers/TelemetryTableControllerSpec.js +++ b/platform/features/table/test/controllers/TelemetryTableControllerSpec.js @@ -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(); diff --git a/platform/features/timeline/test/directives/MCTSwimlaneDropSpec.js b/platform/features/timeline/test/directives/MCTSwimlaneDropSpec.js index 0ae16394a0..60891567cc 100644 --- a/platform/features/timeline/test/directives/MCTSwimlaneDropSpec.js +++ b/platform/features/timeline/test/directives/MCTSwimlaneDropSpec.js @@ -33,7 +33,6 @@ define( mockElement, testAttrs, mockSwimlane, - mockRealElement, testEvent, handlers, directive; diff --git a/platform/forms/test/MCTFormSpec.js b/platform/forms/test/MCTFormSpec.js index 7b5563f6ae..0be985212e 100644 --- a/platform/forms/test/MCTFormSpec.js +++ b/platform/forms/test/MCTFormSpec.js @@ -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); } diff --git a/platform/identity/test/IdentityAggregatorSpec.js b/platform/identity/test/IdentityAggregatorSpec.js index 242ff95eca..c61e8b805b 100644 --- a/platform/identity/test/IdentityAggregatorSpec.js +++ b/platform/identity/test/IdentityAggregatorSpec.js @@ -28,7 +28,6 @@ define( var mockProviders, mockQ, resolves, - mockPromise, mockCallback, testUsers, aggregator; diff --git a/platform/persistence/queue/test/PersistenceFailureHandlerSpec.js b/platform/persistence/queue/test/PersistenceFailureHandlerSpec.js index e6a5f9cc27..7bb0fe8a04 100644 --- a/platform/persistence/queue/test/PersistenceFailureHandlerSpec.js +++ b/platform/persistence/queue/test/PersistenceFailureHandlerSpec.js @@ -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(); diff --git a/platform/policy/test/PolicyActionDecoratorSpec.js b/platform/policy/test/PolicyActionDecoratorSpec.js index a098d508e4..fb9c7b6724 100644 --- a/platform/policy/test/PolicyActionDecoratorSpec.js +++ b/platform/policy/test/PolicyActionDecoratorSpec.js @@ -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)) diff --git a/platform/policy/test/PolicyViewDecoratorSpec.js b/platform/policy/test/PolicyViewDecoratorSpec.js index 30829f46ce..91e86e9bd1 100644 --- a/platform/policy/test/PolicyViewDecoratorSpec.js +++ b/platform/policy/test/PolicyViewDecoratorSpec.js @@ -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)) diff --git a/platform/representation/test/actions/ContextMenuActionSpec.js b/platform/representation/test/actions/ContextMenuActionSpec.js index 3af48fb3c5..bab5a311f5 100644 --- a/platform/representation/test/actions/ContextMenuActionSpec.js +++ b/platform/representation/test/actions/ContextMenuActionSpec.js @@ -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 () { diff --git a/platform/representation/test/gestures/GestureRepresenterSpec.js b/platform/representation/test/gestures/GestureRepresenterSpec.js index ceffa2e734..f66696ed99 100644 --- a/platform/representation/test/gestures/GestureRepresenterSpec.js +++ b/platform/representation/test/gestures/GestureRepresenterSpec.js @@ -27,7 +27,6 @@ define( describe("A gesture representer", function () { var mockGestureService, mockGestureHandle, - mockScope, mockElement, representer; diff --git a/platform/search/test/controllers/SearchMenuControllerSpec.js b/platform/search/test/controllers/SearchMenuControllerSpec.js index 1c0949a67c..bff6dab569 100644 --- a/platform/search/test/controllers/SearchMenuControllerSpec.js +++ b/platform/search/test/controllers/SearchMenuControllerSpec.js @@ -29,7 +29,6 @@ define( describe("The search menu controller", function () { var mockScope, - mockPromise, mockTypes, controller; diff --git a/platform/telemetry/test/TelemetryDelegatorSpec.js b/platform/telemetry/test/TelemetryDelegatorSpec.js index 5c5897cf30..0841020449 100644 --- a/platform/telemetry/test/TelemetryDelegatorSpec.js +++ b/platform/telemetry/test/TelemetryDelegatorSpec.js @@ -25,7 +25,11 @@ define( function (TelemetryDelegator) { describe("The telemetry delegator", function () { + var delegator; + beforeEach(function () { + delegator = new TelemetryDelegator(); + }); }); } );