Fixes failing tests

This commit is contained in:
Joshi 2020-03-12 14:38:39 -07:00
parent 74a7ef2565
commit 81caa27cba
2 changed files with 15 additions and 9 deletions

View File

@ -27,6 +27,14 @@ describe('ConditionManager', () => {
let conditionMgr;
let mockListener;
let openmct = {};
let mockCondition = {
isDefault: true,
type: 'condition',
id: '1234-5678',
configuration: {
criteria: []
}
};
let conditionSetDomainObject = {
identifier: {
namespace: "",
@ -35,14 +43,11 @@ describe('ConditionManager', () => {
type: "conditionSet",
location: "mine",
configuration: {
conditionCollection: []
conditionCollection: [
mockCondition
]
}
};
let mockCondition = {
isDefault: true,
type: 'condition',
id: '1234-5678'
};
function mockAngularComponents() {
let mockInjector = jasmine.createSpyObj('$injector', ['get']);
@ -87,9 +92,9 @@ describe('ConditionManager', () => {
});
it('creates a conditionCollection with a default condition', function () {
expect(conditionMgr.domainObject.configuration.conditionCollection.length).toEqual(1);
let defaultCondition = conditionMgr.domainObject.configuration.conditionCollection[0];
expect(defaultCondition).toEqual(mockCondition);
expect(conditionMgr.conditionSetDomainObject.configuration.conditionCollection.length).toEqual(1);
let defaultConditionId = conditionMgr.conditionClassCollection[0].id;
expect(defaultConditionId).toEqual(mockCondition.id);
});
});

View File

@ -64,6 +64,7 @@ describe("The condition", function () {
openmct.telemetry.getMetadata.and.returnValue(testTelemetryObject.telemetry.values);
testConditionDefinition = {
id: '123-456',
configuration: {
trigger: TRIGGER.ANY,
criteria: [