- 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);
- });
- });
-