]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.spec.ts
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / host.service.spec.ts
index a9354ce54f7b022d7a0f738bc0b7d4bb853fa203..0f58cd098aff62433a5d97aceb69af524c7901e0 100644 (file)
@@ -28,11 +28,18 @@ describe('HostService', () => {
 
   it('should call list', fakeAsync(() => {
     let result;
-    service.list().then((resp) => (result = resp));
+    service.list().subscribe((resp) => (result = resp));
     const req = httpTesting.expectOne('api/host');
     expect(req.request.method).toBe('GET');
     req.flush(['foo', 'bar']);
     tick();
     expect(result).toEqual(['foo', 'bar']);
   }));
+
+  it('should make a GET request on the devices endpoint when requesting devices', () => {
+    const hostname = 'hostname';
+    service.getDevices(hostname).subscribe();
+    const req = httpTesting.expectOne(`api/host/${hostname}/devices`);
+    expect(req.request.method).toBe('GET');
+  });
 });