From e0c5bca47dd08ee9112a96c35d7d4b361f6b1f55 Mon Sep 17 00:00:00 2001 From: David Tsay Date: Mon, 6 Apr 2020 14:25:55 -0700 Subject: [PATCH] fix unit tests --- src/plugins/condition/ConditionManagerSpec.js | 7 +++++++ src/plugins/condition/ConditionSpec.js | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/plugins/condition/ConditionManagerSpec.js b/src/plugins/condition/ConditionManagerSpec.js index cc5b12f441..869bdb6cb6 100644 --- a/src/plugins/condition/ConditionManagerSpec.js +++ b/src/plugins/condition/ConditionManagerSpec.js @@ -49,6 +49,7 @@ describe('ConditionManager', () => { }; let mockComposition; let loader; + let mockTimeSystems; function mockAngularComponents() { let mockInjector = jasmine.createSpyObj('$injector', ['get']); @@ -111,6 +112,12 @@ describe('ConditionManager', () => { openmct.objects.observe.and.returnValue(function () {}); openmct.objects.mutate.and.returnValue(function () {}); + mockTimeSystems = { + key: 'utc' + }; + openmct.time = jasmine.createSpyObj('time', ['getAllTimeSystems']); + openmct.time.getAllTimeSystems.and.returnValue([mockTimeSystems]); + conditionMgr = new ConditionManager(conditionSetDomainObject, openmct); conditionMgr.on('conditionSetResultUpdated', mockListener); diff --git a/src/plugins/condition/ConditionSpec.js b/src/plugins/condition/ConditionSpec.js index a93dcef723..79cbdab220 100644 --- a/src/plugins/condition/ConditionSpec.js +++ b/src/plugins/condition/ConditionSpec.js @@ -30,7 +30,8 @@ let openmct = {}, testTelemetryObject, conditionObj, conditionManager, - mockBroadcastTelemetry; + mockBroadcastTelemetry, + mockTimeSystems; describe("The condition", function () { @@ -74,6 +75,12 @@ describe("The condition", function () { openmct.telemetry.subscribe.and.returnValue(function () {}); openmct.telemetry.getMetadata.and.returnValue(testTelemetryObject.telemetry.values); + mockTimeSystems = { + key: 'utc' + }; + openmct.time = jasmine.createSpyObj('time', ['getAllTimeSystems']); + openmct.time.getAllTimeSystems.and.returnValue([mockTimeSystems]); + testConditionDefinition = { id: '123-456', configuration: {