X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=ceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Ffrontend%2Fsrc%2Fapp%2Fshared%2Fdatatable%2Ftable%2Ftable.component.spec.ts;h=53c246d6e0bc66a42843d6cfabda3da323ad3f6a;hb=39ae355f72b1d71f2212a99f2bd9f6c1e0d35528;hp=f0f649780afed5270d91d24d2e183ab16b58937c;hpb=e04241aa9b639588fa6c864845287d2824cb6b55;p=ceph.git diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts index f0f649780..53c246d6e 100644 --- a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts +++ b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts @@ -16,6 +16,7 @@ import { CdTableFetchDataContext } from '~/app/shared/models/cd-table-fetch-data import { CdTableSelection } from '~/app/shared/models/cd-table-selection'; import { PipesModule } from '~/app/shared/pipes/pipes.module'; import { configureTestBed } from '~/testing/unit-test-helper'; +import { TablePaginationComponent } from '../table-pagination/table-pagination.component'; import { TableComponent } from './table.component'; describe('TableComponent', () => { @@ -39,7 +40,7 @@ describe('TableComponent', () => { }; configureTestBed({ - declarations: [TableComponent], + declarations: [TableComponent, TablePaginationComponent], imports: [ BrowserAnimationsModule, NgxDatatableModule, @@ -568,33 +569,15 @@ describe('TableComponent', () => { expect(executingElement.nativeElement.textContent.trim()).toBe(`(${state})`); }; - it('should display executing template', () => { + it.only('should display executing template', () => { testExecutingTemplate(); }); - it('should display executing template with custom classes', () => { + it.only('should display executing template with custom classes', () => { testExecutingTemplate({ valueClass: 'a b', executingClass: 'c d' }); }); }); - describe('test unselect functionality of rows', () => { - beforeEach(() => { - component.autoReload = -1; - component.selectionType = 'single'; - fixture.detectChanges(); - }); - - it('should unselect row on clicking on it again', () => { - const rowCellDebugElement = fixture.debugElement.query(By.css('datatable-body-cell')); - - rowCellDebugElement.triggerEventHandler('click', null); - expect(component.selection.selected.length).toEqual(1); - - rowCellDebugElement.triggerEventHandler('click', null); - expect(component.selection.selected.length).toEqual(0); - }); - }); - describe('reload data', () => { beforeEach(() => { component.ngOnInit();