summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.spec.ts')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.spec.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.spec.ts
index e9b8ff85..c4c200e7 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.spec.ts
@@ -78,8 +78,10 @@ describe('ColumnListComponent', () => {
it('should test close method',()=>{
let spy1=spyOn(_columnService,'getColumnList').and.returnValue(Observable.of(''));
+ const spy = spyOn((component as any).changeDetectorRefs, 'detectChanges');
component.close();
expect(spy1).toHaveBeenCalled();
+ expect(spy).toHaveBeenCalled();
expect(component.finalObjArr).toEqual([]);
expect(component.finalGetObj).toEqual('');
expect(component.dataSource.data).toEqual(component.finalObjArr);
@@ -103,7 +105,9 @@ it('should test onCompleted method',()=>{
it('should test save method',()=>{
component.noWrap=true;
+ const spy = spyOn((component as any).changeDetectorRefs, 'detectChanges');
component.save();
+ expect(spy).toHaveBeenCalled();
expect(component.showSpinner).toBe(true);
expect(component.finalPOSTObj["tabId"]).toEqual("ColEdit");
expect(component.finalPOSTObj["tabName"]).toEqual("Column Edit");
@@ -140,8 +144,10 @@ it('should test save method',()=>{
it('should test if codition inside save method',()=>{
component.showSaveColDialog=true;
let spy=spyOn(_columnService,'postColumnChanges').and.returnValue(Observable.of('you object'))
+ const spy1 = spyOn((component as any).changeDetectorRefs, 'detectChanges');
component.save();
expect(spy).toHaveBeenCalled();
+ expect(spy1).toHaveBeenCalled();
expect(component.EditColstatus).toEqual("Success!");
expect(component.EditColmessage).toEqual("Your change has been saved! Row definition is updated.");
expect(component.showSaveColDialog).toBe(false);
@@ -151,8 +157,10 @@ it('should test if codition inside save method',()=>{
it('should test else codition inside save method',()=>{
component.showSaveColDialog=true;
let spy=spyOn(_columnService,'postColumnChanges').and.returnValue(Observable.of(''))
+ const spy1 = spyOn((component as any).changeDetectorRefs, 'detectChanges');
component.save();
expect(spy).toHaveBeenCalled();
+ expect(spy1).toHaveBeenCalled();
expect(component.EditColstatus).toEqual("Failure!");
expect(component.EditColmessage).toEqual("Row definition could not be updated.");
expect(component.showSaveColDialog).toBe(false);