]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | import { TestBed } from '@angular/core/testing'; |
2 | ||
f67539c2 | 3 | import { configureTestBed } from '~/testing/unit-test-helper'; |
11fdf7f2 TL |
4 | import { RbdConfigurationType } from '../models/configuration'; |
5 | import { RbdConfigurationService } from './rbd-configuration.service'; | |
6 | ||
7 | describe('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 | }); |