summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
diff options
context:
space:
mode:
authorAlexey Sandler <alexey.sandler@intl.att.com>2020-03-31 22:40:10 +0300
committerAlexey Sandler <alexey.sandler@intl.att.com>2020-04-01 14:37:01 +0300
commita29c7c0207aea6bd28f30e73c8ab43225f2b91fb (patch)
tree725bdf46d35db208e91ea69d3d9ff88aadff5d98 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
parentfae75696a03ab5b45bf2ddb329344ab52b2265c5 (diff)
Show the VF module version on the view/edit screen
Issue-ID: VID-800 Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com> Change-Id: If4eebaeb8f0ce89121e166e0aca10895a17c6155 Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
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([