blob: 9142e8d0f0c7760c448336c9c874fb77e28c29eb [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001import {getTestBed, TestBed} from '@angular/core/testing';
2import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
3import {MsoService} from './mso.service';
4import {Constants} from "../../utils/constants";
5
6
7describe('Mso Service', () => {
8 let injector;
9 let service: MsoService;
10 let httpMock: HttpTestingController;
11
12 beforeAll(done => (async () => {
13 TestBed.configureTestingModule({
14 imports: [HttpClientTestingModule],
15 providers: [MsoService]
16 });
17 await TestBed.compileComponents();
18
19
20 injector = getTestBed();
21 service = injector.get(MsoService);
22 httpMock = injector.get(HttpTestingController);
23
24 })().then(done).catch(done.fail));
25
26 describe('#instantiation status tests ', ()=> {
27 test('retry should send the right request', ()=>{
28 const jobId: string = '111';
29
30 service.retryMsoTask(jobId).subscribe();
31 const req = httpMock.expectOne(Constants.Path.SERVICES_JOB_INFO_PATH + '/retry/' + jobId);
32
33 expect(req.request.method).toBe('POST');
34 });
35 });
36
37});