Added test case for form-fields component 91/100791/1
authorRupinder <rupinsi1@in.ibm.com>
Sat, 25 Jan 2020 06:21:43 +0000 (11:51 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Sat, 25 Jan 2020 06:25:07 +0000 (11:55 +0530)
Written test cases for form-fields component

Issue-ID: PORTAL-808
Change-Id: Ifaedc38493bf8e89ce5b3a3cfba2782a54a66665
Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.spec.ts

index ba690f1..a287046 100644 (file)
@@ -28,7 +28,20 @@ describe('FormFieldsComponent', () => {
   })
 
   it('should test isLast functions', () =>{
-    component.formFieldsListObj.length = 4;
-    expect(component.isLast(3)).toEqual(true);
+    component.formFieldsListObj = [1,2,3,4,5];
+    let test: Boolean =  component.isLast(3);
+    expect(test).toEqual(false);
   })
+
+  it('should test isFirst function', () => {
+    let test: Boolean = component.isFirst(0);
+    expect(test).toEqual(true);
+  })
+
+  it('should test ngDoCheck', () => {
+    component.sqlAsDefaultValue = true;
+    component.ngDoCheck();
+    expect(component.showDefaultSQLOption).toEqual(true);    
+  })
+  
 });