]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts
import ceph quincy 17.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / datatable / table / table.component.spec.ts
index f0f649780afed5270d91d24d2e183ab16b58937c..53c246d6e0bc66a42843d6cfabda3da323ad3f6a 100644 (file)
@@ -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();