]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.spec.ts
import ceph nautilus 14.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / configuration.service.spec.ts
index 0b4133e5a409a26f2ff079436aa57afdae73dc43..9add3a5b7745bba789dba199f988a14c67999b9a 100644 (file)
@@ -51,4 +51,30 @@ describe('ConfigurationService', () => {
     expect(req.request.method).toBe('POST');
     expect(req.request.body).toEqual(configOption);
   });
+
+  it('should call bulkCreate', () => {
+    const configOptions = {
+      configOption1: { section: 'section', value: 'value' },
+      configOption2: { section: 'section', value: 'value' }
+    };
+    service.bulkCreate(configOptions).subscribe();
+    const req = httpTesting.expectOne('api/cluster_conf/');
+    expect(req.request.method).toBe('PUT');
+    expect(req.request.body).toEqual(configOptions);
+  });
+
+  it('should call filter', () => {
+    const configOptions = ['configOption1', 'configOption2', 'configOption3'];
+    service.filter(configOptions).subscribe();
+    const req = httpTesting.expectOne(
+      'api/cluster_conf/filter?names=configOption1,configOption2,configOption3'
+    );
+    expect(req.request.method).toBe('GET');
+  });
+
+  it('should call delete', () => {
+    service.delete('testOption', 'testSection').subscribe();
+    const reg = httpTesting.expectOne('api/cluster_conf/testOption?section=testSection');
+    expect(reg.request.method).toBe('DELETE');
+  });
 });