]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
1d03cf2a8bcaafd27e4fe0db2396343301dd1b08
[ceph.git] /
1 import { ComponentFixture, TestBed } from '@angular/core/testing';
2
3 import { CephfsSubvolumeSnapshotsListComponent } from './cephfs-subvolume-snapshots-list.component';
4 import { HttpClientTestingModule } from '@angular/common/http/testing';
5 import { SharedModule } from '~/app/shared/shared.module';
6
7 describe('CephfsSubvolumeSnapshotsListComponent', () => {
8   let component: CephfsSubvolumeSnapshotsListComponent;
9   let fixture: ComponentFixture<CephfsSubvolumeSnapshotsListComponent>;
10
11   beforeEach(async () => {
12     await TestBed.configureTestingModule({
13       declarations: [CephfsSubvolumeSnapshotsListComponent],
14       imports: [HttpClientTestingModule, SharedModule]
15     }).compileComponents();
16
17     fixture = TestBed.createComponent(CephfsSubvolumeSnapshotsListComponent);
18     component = fixture.componentInstance;
19     fixture.detectChanges();
20   });
21
22   it('should create', () => {
23     expect(component).toBeTruthy();
24   });
25
26   it('should show loading when the items are loading', () => {
27     component.isLoading = true;
28     fixture.detectChanges();
29     expect(fixture.nativeElement.querySelector('cd-loading-panel')).toBeTruthy();
30   });
31
32   it('should show the alert panel when there are no subvolumes', () => {
33     component.isLoading = false;
34     component.subvolumeGroupList = [];
35     fixture.detectChanges();
36     expect(fixture.nativeElement.querySelector('cd-alert-panel')).toBeTruthy();
37   });
38 });