mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 22:17:49 +00:00
Addresses comments.
This commit is contained in:
parent
55a195b841
commit
87f76ebfe4
@ -20,51 +20,43 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
import ConditionSetCompositionPolicy from './conditionSetCompositionPolicy';
|
import ConditionSetCompositionPolicy from './ConditionSetCompositionPolicy';
|
||||||
import { createOpenMct } from "testTools";
|
import { createOpenMct } from "testTools";
|
||||||
|
|
||||||
describe('ConditionSetCompositionPolicy', () => {
|
describe('ConditionSetCompositionPolicy', () => {
|
||||||
let policy;
|
let policy;
|
||||||
let openmct;
|
|
||||||
let parentDomainObject;
|
let parentDomainObject;
|
||||||
let childDomainObject;
|
let childDomainObject;
|
||||||
let composition;
|
let composition;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
openmct = createOpenMct();
|
policy = new ConditionSetCompositionPolicy();
|
||||||
policy = new ConditionSetCompositionPolicy(openmct);
|
|
||||||
parentDomainObject = {};
|
parentDomainObject = {};
|
||||||
childDomainObject = {};
|
childDomainObject = {};
|
||||||
composition = {};
|
composition = {};
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns true for object types that are not conditionSets', function () {
|
it('returns true for object types that are not conditionSets', function () {
|
||||||
parentDomainObject = {
|
parentDomainObject.type = 'random';
|
||||||
type: 'random'
|
childDomainObject.type = '';
|
||||||
};
|
|
||||||
childDomainObject = {
|
|
||||||
type: ''
|
|
||||||
};
|
|
||||||
expect(policy.allow(parentDomainObject, childDomainObject)).toBe(true);
|
expect(policy.allow(parentDomainObject, childDomainObject)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false for object types that are not conditions when parent is a conditionSet', function () {
|
it('returns false for object types that are not conditions when parent is a conditionSet', function () {
|
||||||
parentDomainObject = {
|
parentDomainObject.type = 'conditionSet';
|
||||||
type: 'conditionSet'
|
childDomainObject.type = '';
|
||||||
};
|
|
||||||
childDomainObject = {
|
|
||||||
type: ''
|
|
||||||
};
|
|
||||||
expect(policy.allow(parentDomainObject, childDomainObject)).toBe(false);
|
expect(policy.allow(parentDomainObject, childDomainObject)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns true for object types that are conditions when parent is a conditionSet', function () {
|
it('returns true for object types that are conditions when parent is a conditionSet', function () {
|
||||||
parentDomainObject = {
|
parentDomainObject.type = 'conditionSet';
|
||||||
type: 'conditionSet'
|
childDomainObject.type = 'condition';
|
||||||
};
|
expect(policy.allow(parentDomainObject, childDomainObject)).toBe(true);
|
||||||
childDomainObject = {
|
});
|
||||||
type: 'condition'
|
|
||||||
};
|
it('returns true for object types that are conditions when parent is not a conditionSet', function () {
|
||||||
|
parentDomainObject.type = 'random';
|
||||||
|
childDomainObject.type = 'condition';
|
||||||
expect(policy.allow(parentDomainObject, childDomainObject)).toBe(true);
|
expect(policy.allow(parentDomainObject, childDomainObject)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user