let component: RbdListComponent;
let summaryService: SummaryService;
let rbdService: RbdService;
+ let headers: HttpHeaders;
const refresh = (data: any) => {
summaryService['summaryDataSource'].next(data);
component = fixture.componentInstance;
summaryService = TestBed.inject(SummaryService);
rbdService = TestBed.inject(RbdService);
+ headers = new HttpHeaders().set('X-Total-Count', '10');
// this is needed because summaryService isn't being reset after each test.
summaryService['summaryDataSource'] = new BehaviorSubject(null);
});
it('should display N/A for Provisioned & Total Provisioned columns if disk usage is null', () => {
- rbdServiceListSpy.and.callFake(() => of([{ pool_name: 'rbd', value: images }]));
+ rbdServiceListSpy.and.callFake(() =>
+ of([{ pool_name: 'rbd', value: images, headers: headers }])
+ );
fixture.detectChanges();
const spanWithoutFastDiff = fixture.debugElement.nativeElement.querySelectorAll(
'.datatable-body-cell-label span'
component.images = images;
refresh({ executing_tasks: [], finished_tasks: [] });
- rbdServiceListSpy.and.callFake(() => of([{ pool_name: 'rbd', value: images }]));
+ rbdServiceListSpy.and.callFake(() =>
+ of([{ pool_name: 'rbd', value: images, headers: headers }])
+ );
fixture.detectChanges();
const spanWithFastDiff = fixture.debugElement.nativeElement.querySelectorAll(
addImage('c');
component.images = images;
refresh({ executing_tasks: [], finished_tasks: [] });
- spyOn(rbdService, 'list').and.callFake(() => of([{ pool_name: 'rbd', value: images }]));
- new HttpHeaders().set('X-Total-Count', '10');
+ spyOn(rbdService, 'list').and.callFake(() =>
+ of([{ pool_name: 'rbd', value: images, headers: headers }])
+ );
fixture.detectChanges();
});
import { RbdService } from '~/app/shared/api/rbd.service';
import { ListWithDetails } from '~/app/shared/classes/list-with-details.class';
-import { TableStatusViewCache } from '~/app/shared/classes/table-status-view-cache';
+import { TableStatus } from '~/app/shared/classes/table-status';
import { ConfirmationModalComponent } from '~/app/shared/components/confirmation-modal/confirmation-modal.component';
import { CriticalConfirmationModalComponent } from '~/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
images: any;
columns: CdTableColumn[];
retries: number;
- tableStatus = new TableStatusViewCache();
+ tableStatus = new TableStatus('light');
selection = new CdTableSelection();
icons = Icons;
count = 0;
private tableContext: CdTableFetchDataContext = null;
-
modalRef: NgbModalRef;
builders = {
onFetchError() {
this.table.reset(); // Disable loading indicator.
- this.tableStatus = new TableStatusViewCache(ViewCacheStatus.ValueException);
+ this.tableStatus = new TableStatus('danger');
}
getRbdImages(context: CdTableFetchDataContext) {