blob: 3aa4713fce2c7371ebc3a156b18849dfe313b4e4 (
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
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RunComponent } from './run.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';
describe('RunComponent', () => {
let component: RunComponent;
let fixture: ComponentFixture<RunComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RunComponent ],
imports: [HttpClientTestingModule, RouterTestingModule]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RunComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should test ngOnInit method', () => {
component.reportType = "Dashboard";
component.ngOnInit();
expect(component.stepNo).toEqual("4");
component.reportType = "test";
component.ngOnInit();
expect(component.stepNo).toEqual("8");
});
});
|