1 import { TestBed } from '@angular/core/testing';
3 import { CephfsSubvolumeService } from './cephfs-subvolume.service';
4 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
5 import { configureTestBed } from '~/testing/unit-test-helper';
7 describe('CephfsSubvolumeService', () => {
8 let service: CephfsSubvolumeService;
9 let httpTesting: HttpTestingController;
12 imports: [HttpClientTestingModule],
13 providers: [CephfsSubvolumeService]
17 TestBed.configureTestingModule({});
18 service = TestBed.inject(CephfsSubvolumeService);
19 httpTesting = TestBed.inject(HttpTestingController);
26 it('should be created', () => {
27 expect(service).toBeTruthy();
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');
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'
41 expect(req.request.method).toBe('DELETE');