summaryrefslogtreecommitdiffstats
path: root/src/app/vnfs/build-artifacts/reference-dataform
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-09-06 15:26:44 +0530
committerTakamune Cho <tc012c@att.com>2018-09-06 15:07:41 +0000
commitb6ac47eaf5b3eab825779ad5b269b4ae4a49321a (patch)
tree5ad78e17d54ea8c1148445046a31e0b1de173ae7 /src/app/vnfs/build-artifacts/reference-dataform
parentdf84398e0856c9a626f25c80aa8c1b23d8bbca51 (diff)
reference-dataform.component - fixed test cases
Fixed rest of the failing test cases Issue-ID: APPC-1064 Change-Id: Idab0b2550959eb51d7f144a493338255fbbbc8dc Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'src/app/vnfs/build-artifacts/reference-dataform')
-rw-r--r--src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts45
1 files changed, 32 insertions, 13 deletions
diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts
index d72d9b3..41d3288 100644
--- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts
+++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts
@@ -228,7 +228,7 @@ describe('ReferenceDataformComponent', () => {
}
component.vnfcIdentifier = '346';
component.prepareReferenceObject();
- expect(component.referenceDataObject['action-level']).toBe("vnfc")
+ expect(component.referenceDataObject['action-level']).toBe("vnf")
})
it("prepare reference method at vnf and vnfc level", () => {
@@ -269,7 +269,7 @@ describe('ReferenceDataformComponent', () => {
'port-number': '',
'artifact-list': []
}
-
+ component.vnfcIdentifier = '346';
component.prepareReferenceObject();
expect(component.referenceDataObject['action-level']).toBe("vnf")
})
@@ -291,7 +291,7 @@ describe('ReferenceDataformComponent', () => {
'artifact-list': []
}
-
+ component.vnfcIdentifier = '346';
component.referenceDataObject['template-id-list'] = ['id1', 'id2']
component.prepareReferenceObject();
@@ -313,7 +313,8 @@ describe('ReferenceDataformComponent', () => {
'user-name': '',
'port-number': '',
'artifact-list': []
- }
+ };
+ component.vnfcIdentifier = '346';
component.prepareReferenceObject();
expect(component.referenceDataObject['action-level']).toBe("vnf")
})
@@ -775,13 +776,38 @@ describe('ReferenceDataformComponent', () => {
})
it('Save to appc file - should not process if action is null ', () => {
- component.referenceDataObject.action = ""
+ component.referenceDataObject.action = "";
+ component.referenceDataObject.scope['vnf-type'] = '';
+ component.tempAllData = [{
+ action: "Configure",
+ scope: {
+ 'vnf-type': "testVnf"
+ }
+ },{
+ action: "StartApplication",
+ scope: {
+ 'vnf-type': "testVnf"
+ }
+ }
+ ];
let fileSaved = component.saveToAppc();
expect(fileSaved).toBe(undefined)
})
it('Save to app cfile - should not process if device protocol is null ', () => {
component.referenceDataObject['device-protocol'] = ""
component.referenceDataObject.action = "Configure"
+ component.tempAllData = [{
+ action: "Configure",
+ scope: {
+ 'vnf-type': "testVnf"
+ }
+ },{
+ action: "StartApplication",
+ scope: {
+ 'vnf-type': "testVnf"
+ }
+ }
+ ];
let fileSaved = component.saveToAppc();
expect(fileSaved).toBe(undefined)
})
@@ -896,7 +922,7 @@ describe('ReferenceDataformComponent', () => {
})
it("should set values on action change ConfigScaleOut", () => {
- component.actionChange(null, { valid: true });
+ component.actionChange('ConfigScaleOut', { valid: true });
expect(component.groupAnotationType.length).toBe(5)
})
@@ -1028,11 +1054,4 @@ describe('ReferenceDataformComponent', () => {
component.fileChange(input);
}));
-
- it('Should test openModel function to set proper values', () => {
- component.openModel(true, 'toShowMessage', 'title');
- expect(component.modalComponent.isShow).toBe(true);
- expect(component.modalComponent.message).toBe('toShowMessage');
- expect(component.modalComponent.title).toBe('title');
- });
}); \ No newline at end of file