diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.spec.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.spec.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.spec.ts new file mode 100644 index 000000000..29396866d --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.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 { MonitorService } from './monitor.service'; + +describe('MonitorService', () => { + let service: MonitorService; + let httpTesting: HttpTestingController; + + configureTestBed({ + providers: [MonitorService], + imports: [HttpClientTestingModule] + }); + + beforeEach(() => { + service = TestBed.inject(MonitorService); + httpTesting = TestBed.inject(HttpTestingController); + }); + + afterEach(() => { + httpTesting.verify(); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); + + it('should call getMonitor', () => { + service.getMonitor().subscribe(); + const req = httpTesting.expectOne('api/monitor'); + expect(req.request.method).toBe('GET'); + }); +}); |