1 import { ComponentFixture, TestBed } from '@angular/core/testing';
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';
7 describe('CephfsSubvolumeSnapshotsListComponent', () => {
8 let component: CephfsSubvolumeSnapshotsListComponent;
9 let fixture: ComponentFixture<CephfsSubvolumeSnapshotsListComponent>;
11 beforeEach(async () => {
12 await TestBed.configureTestingModule({
13 declarations: [CephfsSubvolumeSnapshotsListComponent],
14 imports: [HttpClientTestingModule, SharedModule]
15 }).compileComponents();
17 fixture = TestBed.createComponent(CephfsSubvolumeSnapshotsListComponent);
18 component = fixture.componentInstance;
19 fixture.detectChanges();
22 it('should create', () => {
23 expect(component).toBeTruthy();
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();
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();