8e77e7b6aeeeabb87fa400f5bdf34e4ba6348bbd
[portal/sdk.git] /
1 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3 import { MatPaginatorModule } from '@angular/material/paginator';
4 import { MatSortModule } from '@angular/material/sort';
5 import { MatTableModule } from '@angular/material/table';
6
7 import { RunReportComponent } from './run-report.component';
8
9 describe('RunReportFinalTableComponent', () => {
10   let component: RunReportComponent;
11   let fixture: ComponentFixture<RunReportComponent>;
12
13   beforeEach(async(() => {
14     TestBed.configureTestingModule({
15       declarations: [ RunReportComponent ],
16       imports: [
17         NoopAnimationsModule,
18         MatPaginatorModule,
19         MatSortModule,
20         MatTableModule,
21       ]
22     }).compileComponents();
23   }));
24
25   beforeEach(() => {
26     fixture = TestBed.createComponent(RunReportComponent);
27     component = fixture.componentInstance;
28     fixture.detectChanges();
29   });
30
31   it('should compile', () => {
32     expect(component).toBeTruthy();
33   });
34
35  it('should  test ngOnInit method ', () => {
36       component.ngOnInit();
37       expect(component.initialProcesses()).toHaveBeenCalled();
38   });
39
40   it('should test initialProcess method', () => {
41     component.DashboardReportObj.length = 1;
42       component.initialProcesses();
43       expect(component.options.scrollSpeed).toEqual(20);
44   });
45
46   it('should test showError method', () => {
47        component.showError("abc");
48        expect(component.error).toEqual(true);
49        expect(component.showSpinner).toEqual(false);
50   })
51
52
53 });