diff options
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main')
8 files changed, 22 insertions, 46 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts index 1253b2be..bd9bea48 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts @@ -91,12 +91,6 @@ describe('HeaderComponent', () => { expect(component).toBeTruthy(); }); - it('testing if condition in ngOnInit method',()=>{ - component.cookieService.set('show_app_header','false'); - component.ngOnInit(); - expect(component.showHeader).toBe(false) - }) - describe('should test ngOnInit',()=>{ it('should validate on ngOnInit',()=>{ let spy=spyOn(headerService, 'getTopMenuItems').and.returnValue(Observable.of('you object')); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts index 42c176bf..9bbcfc4e 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts @@ -90,13 +90,6 @@ describe('SidebarComponent', () => { expect(component).toBeTruthy(); }); - it('testing if condition in ngOnInit method',()=>{ - component.cookieService.set('show_app_header','false'); - component.ngOnInit(); - expect(component.showHeader).toBe(false) - }) - - describe('should test ngOnInit',()=>{ it('should validate on ngOnInit',()=>{ let spy=spyOn(sidebarService,'getLeftMenu').and.returnValue(Observable.of(stubData1)); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/layout.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/layout.component.spec.ts index 975f72c3..4bc9f5dc 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/layout.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/layout.component.spec.ts @@ -78,12 +78,6 @@ describe('LayoutComponent', () => { expect(component).toBeTruthy(); }); - it('testing if condition in ngOnInit method',()=>{ - component.cookieService.set('show_app_header','false'); - component.ngOnInit(); - expect(component.showHeader).toBe(false) - }) - it('should test receiveCollapsed method',()=>{ component.receiveCollapsed(true); expect(component.collapedSideBar).toBe(true); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts index 8d5c6637..e2b4c720 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts @@ -69,10 +69,6 @@ describe('MenusService', () => { expect(component).toBeTruthy(); }); - // it('should test getTotalRowCount method',()=>{ - // component.getTotalRowCount(); - // }) - it('should test updateStatus method',()=>{ component['updateStatus']('N'); }) diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts index 11daaf84..85f62164 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts @@ -113,10 +113,6 @@ describe('RolesComponent', () => { expect(spy).toHaveBeenCalled(); }) - it('should test getRole method',()=>{ - component.getRole("value"); - }) - it('should test delRoleConfirmPopUp method',()=>{ component.delRoleConfirmPopUp('dummyargument'); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column.service.spec.ts index 22e1cc3d..e663001a 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column.service.spec.ts @@ -12,9 +12,6 @@ describe('ColumnService', () => { imports: [HttpClientTestingModule] })); - // httpClient=TestBed.get(HttpClient); - // httpTestingController=TestBed.get(httpTestingController); - it('should be created', () => { const service: ColumnService = TestBed.get(ColumnService); expect(service).toBeTruthy(); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.spec.ts index e2b08a4f..af8e9db7 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.spec.ts @@ -16,13 +16,7 @@ describe('LogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ LogComponent ], - imports: [HttpClientTestingModule], - // providers:[LogService,MockBackend,BaseRequestOptions,{ - // porvide:Http,useFactory:(backend:MockBackend,defaultOptions:BaseRequestOptions)=>{ - // return new Http(backend,defaultOptions); - // }, - // deps:[MockBackend,BaseRequestOptions], - // }] + imports: [HttpClientTestingModule] }) .compileComponents(); })); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts index 52082c9f..68085b1e 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts @@ -16,7 +16,6 @@ describe('SQLComponentComponent', () => { let fixture: ComponentFixture<SQLComponent>; const reportId = "test"; const finalGetObj = {"query":"dummyQuery"}; - let elements = []; let environment = [ { "baseUrl": 'just for test' @@ -32,9 +31,7 @@ describe('SQLComponentComponent', () => { }) .compileComponents(); sqlService = TestBed.get(SqlService); - let response : any; spyOn(sqlService, 'getSQLTabData').and.returnValue(Observable.of(environment)); - spyOn(sqlService, 'postSQLValidateAndSave').and.returnValue(Observable.of(environment)); })); beforeEach(() => { @@ -82,6 +79,27 @@ describe('SQLComponentComponent', () => { expect(component.SQLclosable).toEqual(true); }); + it('should test saveSQL method else condition',()=>{ + component.SQLPostResponse = false; + component.saveSQL(); + }) + + it('should test validate method',()=>{ + component.sqlText="sqlText"; + var response={"data":{"elements":'{"elements":""}'}} + let spy=spyOn(sqlService,'postSQLValidateAndSave').and.returnValue(Observable.of(response)) + component.validate(); + expect(spy).toHaveBeenCalled(); + }) + + it('should test validate method',()=>{ + component.sqlText="sqlText"; + var response={"data":{"elements":'{"query":"query"}'}} + let spy=spyOn(sqlService,'postSQLValidateAndSave').and.returnValue(Observable.of(response)) + component.validate(); + expect(spy).toHaveBeenCalled(); + }) + it('should test closeSaveModal method', () => { component.closeSaveModal(); expect(component.showSaveSQLDialog).toEqual(component.showSaveSQLDialog); @@ -113,10 +131,4 @@ describe('SQLComponentComponent', () => { expect(component.GetValidateResponseString()).toEqual("test"); }); -// it('should test validate method', () => { -// spyOn(component, 'validate').and.callThrough(); -// component.validate(); -// expect(component.validate).toHaveBeenCalled(); -// }); - }); |