summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts')
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts46
1 files changed, 39 insertions, 7 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
index fcef504fd..60f59de4c 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
@@ -312,23 +312,55 @@ describe('Shared Tree Service', () => {
});
test('statusProperties should be prop on node according to node properties', () => {
- let node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', inMaint: false});
+
+ let node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', type: 'VFmodule', instanceModelInfo:{modelVersion: '1'}, inMaint: false});
expect(node.statusProperties).toBeDefined();
expect(node.statusProperties).toEqual([Object({
- key: 'Prov Status:',
+ key: 'Prov Status: ',
value: 'inProgress',
testId: 'provStatus'
- }), Object({key: 'Orch Status:', value: 'completed', testId: 'orchStatus'})]);
- node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', inMaint: true});
+ }), Object({
+ key: 'Orch Status: ',
+ value: 'completed',
+ testId: 'orchStatus'
+ }),
+ Object({
+ key: 'Model Version: ',
+ value: '1',
+ testId: 'modelVersion'
+ })]);
+ node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress',type: 'VFmodule', instanceModelInfo:{}, inMaint: true});
expect(node.statusProperties).toEqual([Object({
- key: 'Prov Status:',
+ key: 'Prov Status: ',
value: 'inProgress',
testId: 'provStatus'
- }), Object({key: 'Orch Status:', value: 'completed', testId: 'orchStatus'}), Object({
+ }), Object({
+ key: 'Orch Status: ',
+ value: 'completed',
+ testId: 'orchStatus'
+ }), Object({
+ key: 'Model Version: ',
+ value: undefined,
+ testId: 'modelVersion'
+ }), Object({
key: 'In-maintenance',
value: '',
testId: 'inMaint'
- })]);
+ })
+]);
+ });
+ each([
+ ['version 2', '2', '2'],
+ ['undefined', null, undefined]
+ ]).
+ test('getNodeModelVersion should return %s', (description, nodeVersion, expectedVersion) => {
+ let node = <any>{
+ instanceModelInfo:{
+ modelVersion: nodeVersion
+ }
+ };
+ let actualVersion = service.getNodeModelVersion(node);
+ expect(actualVersion).toEqual(expectedVersion);
});
each([