diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.spec.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.spec.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.spec.ts new file mode 100644 index 000000000..82c12dad8 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.spec.ts @@ -0,0 +1,34 @@ +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { TestBed } from '@angular/core/testing'; + +import { configureTestBed } from '~/testing/unit-test-helper'; +import { LogsService } from './logs.service'; + +describe('LogsService', () => { + let service: LogsService; + let httpTesting: HttpTestingController; + + configureTestBed({ + providers: [LogsService], + imports: [HttpClientTestingModule] + }); + + beforeEach(() => { + service = TestBed.inject(LogsService); + httpTesting = TestBed.inject(HttpTestingController); + }); + + afterEach(() => { + httpTesting.verify(); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); + + it('should call getLogs', () => { + service.getLogs().subscribe(); + const req = httpTesting.expectOne('api/logs/all'); + expect(req.request.method).toBe('GET'); + }); +}); |