mirror of
https://github.com/nasa/openmct.git
synced 2025-05-28 13:14:20 +00:00
WIP
This commit is contained in:
parent
6a25cb0a58
commit
ea45f0f4aa
@ -27,7 +27,7 @@ export default function ConditionSet(openmct) {
|
||||
return {
|
||||
key: 'conditionSet',
|
||||
name: 'Condition Set',
|
||||
cssClass: 'icon-summary-widget',
|
||||
cssClass: 'icon-folder',
|
||||
canView: function (domainObject) {
|
||||
return domainObject.type === 'conditionSet';
|
||||
},
|
||||
|
@ -19,6 +19,7 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
import ConditionSetViewProvider from './ConditionSetViewProvider.js';
|
||||
|
||||
export default function ConditionSetPlugin() {
|
||||
const conditionSetType = {
|
||||
@ -26,7 +27,7 @@ export default function ConditionSetPlugin() {
|
||||
key: 'conditionSet',
|
||||
description: 'A set of one or more conditional rules based on user-specified criteria.',
|
||||
creatable: true,
|
||||
cssClass: 'icon-summary-widget',
|
||||
cssClass: 'icon-folder',
|
||||
initialize: function (domainObject) {
|
||||
domainObject.composition = [];
|
||||
domainObject.telemetry = {};
|
||||
@ -34,6 +35,8 @@ export default function ConditionSetPlugin() {
|
||||
};
|
||||
|
||||
return function install(openmct) {
|
||||
openmct.objectViews.addProvider(new ConditionSetViewProvider(openmct));
|
||||
|
||||
openmct.types.addType('conditionSet', conditionSetType);
|
||||
};
|
||||
}
|
||||
|
@ -25,28 +25,32 @@ import { createOpenMct } from 'testTools';
|
||||
|
||||
fdescribe("The plugin", () => {
|
||||
let openmct;
|
||||
let conditionSetType;
|
||||
let mockDomainObject;
|
||||
|
||||
beforeEach(() => {
|
||||
mockDomainObject = {};
|
||||
|
||||
openmct = createOpenMct();
|
||||
openmct.install(new ConditionSetPlugin());
|
||||
conditionSetType = openmct.types.get('conditionSet');
|
||||
|
||||
mockDomainObject = {
|
||||
identifier: {
|
||||
key: 'testKey',
|
||||
namespace: ''
|
||||
},
|
||||
type: 'conditionSet'
|
||||
};
|
||||
});
|
||||
|
||||
it('defines a conditionSet object with the correct key', () => {
|
||||
expect(conditionSetType.definition.key).toEqual('conditionSet');
|
||||
it('defines a conditionSet object type with the correct key', () => {
|
||||
expect(openmct.types.get('conditionSet').definition.key).toEqual('conditionSet');
|
||||
});
|
||||
|
||||
it('defines a conditionSet object that is creatable', () => {
|
||||
expect(conditionSetType.definition.creatable).toBeTrue();
|
||||
it('defines a conditionSet object type that is creatable', () => {
|
||||
expect(openmct.types.get('conditionSet').definition.creatable).toBeTrue();
|
||||
});
|
||||
|
||||
describe("shows the conditionSet object is initialized with", () => {
|
||||
beforeEach(() => {
|
||||
conditionSetType.definition.initialize(mockDomainObject);
|
||||
openmct.types.get('conditionSet').definition.initialize(mockDomainObject);
|
||||
});
|
||||
|
||||
it('a composition array', () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user