Fixed the failng test cases. 97/56497/2
authorIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>
Mon, 16 Jul 2018 10:00:37 +0000 (15:30 +0530)
committerTakamune Cho <tc012c@att.com>
Mon, 16 Jul 2018 14:41:33 +0000 (14:41 +0000)
Fixed the failing test cases for build-artifacts component.
5 of the test cases in build-artifacts component spec were failing with
the below errors,
1. No Provider for Notification Service.
2. Cannot read property 'vnf-type' of undefined.
Fixed the above errors. The coverage for this component is now 84.78%.

Issue-ID: APPC-1064
Change-Id: Ifee45f86ce7093c9783d1f28a313869300bd8e39
Signed-off-by: Arundathi <arundpil@in.ibm.com>
src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts

index 48edb99..a1b4507 100644 (file)
@@ -79,6 +79,7 @@ describe('BuildDesignComponent', () => {
             declarations: [BuildDesignComponent, HomeComponent, TestComponent, HelpComponent, AboutUsComponent, LogoutComponent],
             schemas: [NO_ERRORS_SCHEMA],
             imports: [HttpModule, FormsModule, RouterTestingModule.withRoutes(routes)],
+            providers : [ NotificationsService ]
             
         })
             .compileComponents();
@@ -95,7 +96,23 @@ describe('BuildDesignComponent', () => {
     });
 
     it('Should validate getRefData method', () => {
-        let refData = {"action": "Configure", "vnf-type": "test 1", "device-protocol": "ANSIBLE"};
+        let refData = {"action":"Configure",
+        "action-level":"vnf",
+        "scope": {
+            "vnf-type":"ticktack",
+            "vnfc-type":""
+                },
+         "template":"Y",
+         "vm":[],
+         "device-protocol":"CHEF",
+         "user-name":"",
+         "port-number":"",
+         "artifact-list":[
+             {"artifact-name":"template_Configure_ticktack_0.0.1V.json","artifact-type":"config_template"},
+             {"artifact-name":"pd_Configure_ticktack_0.0.1V.yaml","artifact-type":"parameter_definitions"}],
+        "scopeType":"vnf-type"
+        };
+        
         component.refDataRequiredFiels = false;
         component.getRefData(refData);
         expect(component.refDataRequiredFiels).toBeTruthy();
@@ -128,6 +145,4 @@ describe('BuildDesignComponent', () => {
 
         expect(spy).toHaveBeenCalled();
     });
-
-
 });