summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIndrijeet kumar <indriku1@in.ibm.com>2020-04-02 04:09:55 +0530
committerIndrijeet kumar <indriku1@in.ibm.com>2020-04-02 04:10:08 +0530
commit136163980d48c251ab5a53f7b9d19bf6b6db4d4a (patch)
tree04415c4817cf7e7c1b591b42652c51b0fa8a7a8f
parent7d3ad2425c0a774179ddb522e741d977c3bcf992 (diff)
test cases for edit-drill-down-link comp
test cases for edit-drill-down-link component Issue-ID: PORTAL-813 Change-Id: If0322d5ed20a563f5d7a619577c7ed79793328a8 Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/columns-edit-component/edit-drill-down-link/edit-drill-down-link.component.spec.ts31
1 files changed, 28 insertions, 3 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/columns-edit-component/edit-drill-down-link/edit-drill-down-link.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/columns-edit-component/edit-drill-down-link/edit-drill-down-link.component.spec.ts
index b14778e3..72ded462 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/columns-edit-component/edit-drill-down-link/edit-drill-down-link.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/columns-edit-component/edit-drill-down-link/edit-drill-down-link.component.spec.ts
@@ -3,12 +3,20 @@ import {FormsModule} from '@angular/forms';
import { EditDrillDownLinkComponent } from './edit-drill-down-link.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ColumnService } from '../../column.service';
-import { Observable } from 'rxjs';
+import 'rxjs/add/observable/of';
+import { Observable } from 'rxjs/Observable';
describe('EditDrillDownLinkComponent', () => {
let component: EditDrillDownLinkComponent;
let fixture: ComponentFixture<EditDrillDownLinkComponent>;
+ let _columnService:ColumnService;
const drilldownobj1 = {"drillDownUrl":"dummyURL"}
+ let stubData1=[{
+ "baseUrl":"baseUrl"
+ }];
+ let stubData2=[{
+ "baseUrl":123
+ }]
beforeEach(async(() => {
TestBed.configureTestingModule({
@@ -24,11 +32,28 @@ describe('EditDrillDownLinkComponent', () => {
component = fixture.componentInstance;
component.drillDownObj = drilldownobj1;
fixture.detectChanges();
-
-
+ _columnService=TestBed.get(ColumnService);
});
it('should create', () => {
expect(component).toBeTruthy();
});
+
+ it('getDrillDownReportColumnDetails should return stubbed value',()=>{
+ let spy1=spyOn(_columnService,'getDrillDownReportColumnDetails').and.returnValue(Observable.of('your value'))
+ component.ngOnInit();
+ expect(spy1).toHaveBeenCalled();
+ })
+
+ it('should test getValueOfColumnDetails',()=>{
+ let spy2=spyOn(_columnService,'getValueOfColumnDetails').and.returnValue(Observable.of('your value'))
+ component.ngOnInit();
+ // expect(spy2).toHaveBeenCalled();
+
+ })
+
+ it('should test ngDoCheck method',()=>{
+ component.ngDoCheck();
+ })
+
});