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