]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.spec.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / logs.service.spec.ts
1 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
2 import { TestBed } from '@angular/core/testing';
3
4 import { configureTestBed } from '~/testing/unit-test-helper';
5 import { LogsService } from './logs.service';
6
7 describe('LogsService', () => {
8 let service: LogsService;
9 let httpTesting: HttpTestingController;
10
11 configureTestBed({
12 providers: [LogsService],
13 imports: [HttpClientTestingModule]
14 });
15
16 beforeEach(() => {
17 service = TestBed.inject(LogsService);
18 httpTesting = TestBed.inject(HttpTestingController);
19 });
20
21 afterEach(() => {
22 httpTesting.verify();
23 });
24
25 it('should be created', () => {
26 expect(service).toBeTruthy();
27 });
28
29 it('should call getLogs', () => {
30 service.getLogs().subscribe();
31 const req = httpTesting.expectOne('api/logs/all');
32 expect(req.request.method).toBe('GET');
33 });
34 });