]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs-subvolume.service.spec.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / cephfs-subvolume.service.spec.ts
1 import { TestBed } from '@angular/core/testing';
2
3 import { CephfsSubvolumeService } from './cephfs-subvolume.service';
4 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
5 import { configureTestBed } from '~/testing/unit-test-helper';
6
7 describe('CephfsSubvolumeService', () => {
8 let service: CephfsSubvolumeService;
9 let httpTesting: HttpTestingController;
10
11 configureTestBed({
12 imports: [HttpClientTestingModule],
13 providers: [CephfsSubvolumeService]
14 });
15
16 beforeEach(() => {
17 TestBed.configureTestingModule({});
18 service = TestBed.inject(CephfsSubvolumeService);
19 httpTesting = TestBed.inject(HttpTestingController);
20 });
21
22 afterEach(() => {
23 httpTesting.verify();
24 });
25
26 it('should be created', () => {
27 expect(service).toBeTruthy();
28 });
29
30 it('should call get', () => {
31 service.get('testFS').subscribe();
32 const req = httpTesting.expectOne('api/cephfs/subvolume/testFS?group_name=');
33 expect(req.request.method).toBe('GET');
34 });
35
36 it('should call remove', () => {
37 service.remove('testFS', 'testSubvol').subscribe();
38 const req = httpTesting.expectOne(
39 'api/cephfs/subvolume/testFS?subvol_name=testSubvol&group_name=&retain_snapshots=false'
40 );
41 expect(req.request.method).toBe('DELETE');
42 });
43 });