]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
90817e13f9eadd7fc4fdf155aeb13493232b6973
[ceph.git] /
1 import { HttpClientTestingModule } from '@angular/common/http/testing';
2 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3 import { ComponentFixture, TestBed } from '@angular/core/testing';
4
5 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
6 import { Permissions } from '~/app/shared/models/permissions';
7 import { SharedModule } from '~/app/shared/shared.module';
8 import { NvmeofSubsystemsDetailsComponent } from './nvmeof-subsystems-details.component';
9
10 describe('NvmeofSubsystemsDetailsComponent', () => {
11   let component: NvmeofSubsystemsDetailsComponent;
12   let fixture: ComponentFixture<NvmeofSubsystemsDetailsComponent>;
13
14   beforeEach(async () => {
15     await TestBed.configureTestingModule({
16       declarations: [NvmeofSubsystemsDetailsComponent],
17       imports: [BrowserAnimationsModule, SharedModule, HttpClientTestingModule, NgbNavModule]
18     }).compileComponents();
19
20     fixture = TestBed.createComponent(NvmeofSubsystemsDetailsComponent);
21     component = fixture.componentInstance;
22     component.selection = {
23       serial_number: 'Ceph30487186726692',
24       model_number: 'Ceph bdev Controller',
25       min_cntlid: 1,
26       max_cntlid: 2040,
27       subtype: 'NVMe',
28       nqn: 'nqn.2001-07.com.ceph:1720603703820',
29       namespace_count: 1,
30       max_namespaces: 256
31     };
32     component.permissions = new Permissions({
33       grafana: ['read']
34     });
35     component.ngOnChanges();
36     fixture.detectChanges();
37   });
38
39   it('should create', () => {
40     expect(component).toBeTruthy();
41   });
42
43   it('should prepare data', () => {
44     expect(component.data).toEqual({
45       'Serial Number': 'Ceph30487186726692',
46       'Model Number': 'Ceph bdev Controller',
47       'Minimum Controller Identifier': 1,
48       'Maximum Controller Identifier': 2040,
49       'Subsystem Type': 'NVMe'
50     });
51   });
52 });