summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts
blob: b897f14979024d6d0f5db2b4efe635bd0b987abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatPaginatorModule } from '@angular/material/paginator';
import { MatSortModule } from '@angular/material/sort';
import { MatTableModule } from '@angular/material/table';

import { RunReportComponent } from './run-report.component';

describe('RunReportFinalTableComponent', () => {
  let component: RunReportComponent;
  let fixture: ComponentFixture<RunReportComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ RunReportComponent ],
      imports: [
        NoopAnimationsModule,
        MatPaginatorModule,
        MatSortModule,
        MatTableModule,
      ]
    }).compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(RunReportComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should compile', () => {
    expect(component).toBeTruthy();
  });

 it('should  test ngOnInit method ', () => {
      component.ngOnInit();
      expect(component.initialProcesses()).toHaveBeenCalled();
  });

  it('should test initialProcess method', () => {
    component.DashboardReportObj.length = 1;
      component.initialProcesses();
      expect(component.options.scrollSpeed).toEqual(20);
  });

  it('should test showError method', () => {
       component.showError("abc");
       expect(component.error).toEqual(true);
       expect(component.showSpinner).toEqual(false);
  });

  it('should test afterViewInitialProcesses method ', () =>{
       component.DashboardReportObj.length === 0;
       component.reportMode === "Regular";
       component.initCnt == 0;

       component.afterViewInitialProcesses();
       expect(component.showMoreVert).toEqual(false);
       expect(component.NEWdisplayedColumns).toEqual(new Array());
  });


});