import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
import { CephfsService } from '../../../shared/api/cephfs.service';
import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum';
-import { CdTableSelection } from '../../../shared/models/cd-table-selection';
import { SharedModule } from '../../../shared/shared.module';
import { CephfsClientsComponent } from '../cephfs-clients/cephfs-clients.component';
import { CephfsDetailComponent } from '../cephfs-detail/cephfs-detail.component';
};
};
- const setSelection = (selection: object[]) => {
- component.selection.selected = selection;
+ const setSelection = (selection: any) => {
+ component.selection = selection;
component.ngOnChanges();
};
const selectFs = (id: number, name: string) => {
- setSelection([
- {
- id,
- mdsmap: {
- info: {
- something: {
- name
- }
+ setSelection({
+ id,
+ mdsmap: {
+ info: {
+ something: {
+ name
}
}
}
- ]);
+ });
};
const updateData = () => {
beforeEach(() => {
fixture = TestBed.createComponent(CephfsTabsComponent);
component = fixture.componentInstance;
- component.selection = new CdTableSelection();
+ component.selection = undefined;
data = {
standbys: 'b',
pools: [{}, {}],
});
it('should resist invalid mds info', () => {
- setSelection([
- {
- id: 3,
- mdsmap: {
- info: {}
- }
+ setSelection({
+ id: 3,
+ mdsmap: {
+ info: {}
}
- ]);
+ });
expect(component.grafanaId).toBe(undefined);
});
});
it('should should unsubscribe on deselect', () => {
- setSelection([]);
+ setSelection(undefined);
expect(old.unsubscribed).toBe(true);
expect(getReload()).toBe(undefined); // Cleared timer subscription
});