summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.component.spec.ts41
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts27
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts16
3 files changed, 78 insertions, 6 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.component.spec.ts
index 5cd70a7c..b9d63853 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.component.spec.ts
@@ -1,6 +1,8 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
+import { FormsModule } from '@angular/forms';
import { DashboardReportGridComponent } from './dashboard-report-grid.component';
+import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
describe('DashboardReportGridComponent', () => {
let component: DashboardReportGridComponent;
@@ -8,10 +10,12 @@ describe('DashboardReportGridComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [ DashboardReportGridComponent ]
+ schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
+ declarations: [ DashboardReportGridComponent ],
+ imports: [FormsModule, HttpClientTestingModule]
})
.compileComponents();
- }));
+ }));
beforeEach(() => {
fixture = TestBed.createComponent(DashboardReportGridComponent);
@@ -22,4 +26,33 @@ describe('DashboardReportGridComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
-});
+
+ it('should test ngOnInit method', () => {
+ component.ngOnInit();
+ expect(component.showSpinner).toEqual(true);
+ expect(component.options.outerMargin).toEqual(true);
+ expect(component.options.outerMarginTop).toEqual(10);
+ expect(component.options.outerMarginRight).toEqual(10);
+ expect(component.options.outerMarginBottom).toEqual(700);
+ expect(component.options.outerMarginLeft).toEqual(10);
+ expect(component.options.scrollSensitivity).toEqual(10);
+ expect(component.options.scrollSpeed).toEqual(20);
+ expect(component.options.emptyCellDragMaxCols).toEqual(null);
+ expect(component.options.emptyCellDragMaxRows).toEqual(null);
+ expect(component.options.enableOccupiedCellDrop).toEqual(true);
+ expect(component.options.ignoreMarginInRow).toEqual(false);
+ expect(component.options.draggable.enabled).toEqual(true);
+ expect(component.options.resizable.enabled).toEqual(true);
+ expect(component.options.swap).toEqual(false);
+ expect(component.options.pushItems).toEqual(true);
+ expect(component.options.disablePushOnDrag).toEqual(false);
+ expect(component.options.disablePushOnResize).toEqual(false);
+ expect(component.options.pushResizeItems).toEqual(true);
+ expect(component.options.disableWindowResize).toEqual(true);
+ expect(component.options.disableWarnings).toEqual(false);
+ expect(component.options.scrollToNewItems).toEqual(true);
+ expect(component.options.enableEmptyCellDrop).toEqual(true);
+ expect(component.options.minCols).toEqual(2);
+ expect(component.options.minRows).toEqual(2);
+ })
+}); \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts
index 5c6fc2cb..1c96f7ed 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts
@@ -1,12 +1,37 @@
import { TestBed } from '@angular/core/testing';
import { DashboardReportService } from './dashboard-report.service';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { HttpClient } from '@angular/common/http';
+import { environment } from 'src/environments/environment';
describe('DashboardReportService', () => {
- beforeEach(() => TestBed.configureTestingModule({}));
+
+ let service: DashboardReportService;
+
+ beforeEach(() => {TestBed.configureTestingModule({
+ imports: [HttpClientTestingModule],
+ providers: [HttpClient, HttpClientTestingModule, DashboardReportService]
+ });
+ service = TestBed.get(DashboardReportService);
+
+});
it('should be created', () => {
const service: DashboardReportService = TestBed.get(DashboardReportService);
expect(service).toBeTruthy();
});
+
+ it('should getReportData', () => {
+ service.getReportData("test").subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
+ it('should getReportDataWithFormFields', () => {
+ service.getReportDataWithFormFields("just", "test").subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts
index b7f186b9..5afbea4b 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts
@@ -1,6 +1,10 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SecurityComponent } from './security.component';
+import { FormsModule } from '@angular/forms';
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { componentRefresh } from '@angular/core/src/render3/instructions';
describe('SecurityComponent', () => {
let component: SecurityComponent;
@@ -8,7 +12,9 @@ describe('SecurityComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [ SecurityComponent ]
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ declarations: [ SecurityComponent ],
+ imports: [FormsModule, HttpClientTestingModule]
})
.compileComponents();
}));
@@ -22,4 +28,12 @@ describe('SecurityComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
+
+ it('should test ngOnInit method', () => {
+ component.reportType === "Dashboard";
+ component.ngOnInit();
+ expect(component.showSpinner).toEqual(true);
+ expect(component.stepNo).toEqual('6');
+ });
+
});