summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.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/run/run-report-form-fields/run-report-form-fields.component.spec.ts')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.spec.ts123
1 files changed, 0 insertions, 123 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.spec.ts
deleted file mode 100644
index 640128ce..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.spec.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import {FormsModule} from '@angular/forms';
-import { RunReportFormFieldsComponent } from './run-report-form-fields.component';
-import { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
-import {MatDatepickerModule} from '@angular/material/datepicker';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { RunService } from '../run.service';
-import { Observable } from 'rxjs/Observable';
-import 'rxjs/add/observable/of';
-
-describe('RunReportFormFieldsComponent', () => {
- let component: RunReportFormFieldsComponent;
- let fixture: ComponentFixture<RunReportFormFieldsComponent>;
- let formfield =[{"validationType":1},{},{}] ;
- let runService: RunService;
- let formFieldGroupObjList: {}[] = [];
- let environment = [
- {
- baseUrl: 'just for testing'
- }
- ]
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
- imports: [FormsModule, MatDatepickerModule, HttpClientTestingModule, RouterTestingModule],
- declarations: [ RunReportFormFieldsComponent ],
- providers: [RunService]
- })
- .compileComponents();
- runService = TestBed.get(RunService);
- spyOn(runService, 'getDefinitionPageDetails').and.returnValue(Observable.of(environment));
- spyOn(runService, 'refreshFormFields').and.returnValue(Observable.of(environment));
- spyOn(runService, 'getFormFieldGroupsData').and.returnValue(Observable.of(environment));
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(RunReportFormFieldsComponent);
- component = fixture.componentInstance;
- component.formFieldList = formfield;
- component.formFieldGroupObjList = formFieldGroupObjList;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-
- it('should test convertDate method', () => {
- component.convertDate("test");
- });
-
- it('should test getQueryString methods', () => {
- component.directCallQueryParams = 'abc';
- component.getQueryString();
- expect(component.getQueryString()).toEqual(component.directCallQueryParams);
-
- component.directCallQueryParams = "";
- component.getQueryString();
- expect(component.getQueryString()).toEqual(component.queryString);
- });
-
- it('should test showError method', () => {
- component.showError('test');
- expect(component.errorMessage).toEqual('test'['errormessage']);
- expect(component.stackTrace).toEqual('test'['stacktrace']);
- expect(component.error).toEqual(true);
- expect(component.showSpinner).toEqual(false);
- });
-
- it('should test showLabelFn method', () => {
- component.showLabelFn();
- expect(component.showLabel).toEqual(component.showLabel);
- });
-
- it('should test runReport method', () => {
- component.iSDashboardReport = "Dashboard";
- component.formFieldList.length = 1;
- component.runReport();
-
- expect(component.hitCnt).toBe(component.hitCnt++);
- expect(component.reportMode).toBe('')
- let spy = spyOn(component, 'generateQueryString');
- component.generateQueryString();
- expect(component.generateQueryString).toHaveBeenCalled();
- expect(component.showSpinner).toBe(false);
-
- component.iSDashboardReport = "Dashboard";
- component.formFieldList.length = 0;
- component.runReport();
-
- expect(component.reportMode).toBe('');
-
- component.iSDashboardReport = "Dashboard";
- component.runReport();
- expect(component.showSpinner).toBe(false);
- expect(component.navigateToRun).toBe(true);
-
-
- });
-
- it('should test ngDoCheck method', () =>{
- component.formFieldList != undefined;
- component.oldGroupSelectValue = "test";
- component.groupSelectValue = "testing";
- spyOn(component, 'ngDoCheck').and.callThrough();
- component.ngDoCheck();
- expect(component.ngDoCheck).toHaveBeenCalled();
- expect(component.oldGroupSelectValue).toBe(component.groupSelectValue);
- });
-
- it('should test generateQueryString method',() => {
- component.generateQueryString();
- })
-
- it('should test ngOnInit method', () => {
- spyOn(component, 'ngOnInit').and.callThrough();
- component.ngOnInit();
- expect(component.ngOnInit).toHaveBeenCalled();
- });
-
-}); \ No newline at end of file