Fix selection reset issue (#2414)

This commit is contained in:
Popovics András 2017-10-03 16:05:06 +01:00 committed by Eugenio Romano
parent 757128186c
commit 8afe358f33
2 changed files with 7 additions and 0 deletions

View File

@ -198,6 +198,12 @@ describe('DocumentList', () => {
expect(documentList.resetSelection).toHaveBeenCalled(); expect(documentList.resetSelection).toHaveBeenCalled();
}); });
it('should reset selection in the datatable also', () => {
spyOn(documentList.dataTable, 'resetSelection').and.callThrough();
documentList.loadFolderByNodeId('-trashcan-');
expect(documentList.dataTable.resetSelection).toHaveBeenCalled();
});
it('should empty template be present when no element are present', (done) => { it('should empty template be present when no element are present', (done) => {
documentList.currentFolderId = '1d26e465-dea3-42f3-b415-faa8364b9692'; documentList.currentFolderId = '1d26e465-dea3-42f3-b415-faa8364b9692';
documentList.folderNode = new NodeMinimal(); documentList.folderNode = new NodeMinimal();

View File

@ -484,6 +484,7 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
} }
resetSelection() { resetSelection() {
this.dataTable.resetSelection();
this.selection = []; this.selection = [];
} }