]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/rbd-configuration.service.spec.ts
update ceph source to reef 18.2.0
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / services / rbd-configuration.service.spec.ts
CommitLineData
11fdf7f2
TL
1import { TestBed } from '@angular/core/testing';
2
f67539c2 3import { configureTestBed } from '~/testing/unit-test-helper';
11fdf7f2
TL
4import { RbdConfigurationType } from '../models/configuration';
5import { RbdConfigurationService } from './rbd-configuration.service';
6
7describe('RbdConfigurationService', () => {
8 let service: RbdConfigurationService;
9
10 configureTestBed({
f67539c2 11 providers: [RbdConfigurationService]
11fdf7f2
TL
12 });
13
14 beforeEach(() => {
f67539c2 15 service = TestBed.inject(RbdConfigurationService);
11fdf7f2
TL
16 });
17
18 it('should be created', () => {
19 expect(service).toBeTruthy();
20 });
21
22 it('should filter config options', () => {
23 const result = service.getOptionByName('rbd_qos_write_iops_burst');
24 expect(result).toEqual({
25 name: 'rbd_qos_write_iops_burst',
26 displayName: 'Write IOPS Burst',
27 description: 'The desired burst limit of write operations.',
28 type: RbdConfigurationType.iops
29 });
30 });
31
32 it('should return the display name', () => {
33 const displayName = service.getDisplayName('rbd_qos_write_iops_burst');
34 expect(displayName).toBe('Write IOPS Burst');
35 });
36
37 it('should return the description', () => {
38 const description = service.getDescription('rbd_qos_write_iops_burst');
39 expect(description).toBe('The desired burst limit of write operations.');
40 });
41
42 it('should have a class for each section', () => {
43 service.sections.forEach((section) => expect(section.class).toBeTruthy());
44 });
45});