[ACA-4224] DocumentList - clear filterers action renders previous selection toolbar actions (#2007)

* also reset instance state

* fix test
This commit is contained in:
Cilibiu Bogdan 2021-02-19 18:20:34 +02:00 committed by GitHub
parent 423fb05008
commit 28876a30e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -151,11 +151,12 @@ describe('DocumentListDirective', () => {
expect(storeMock.dispatch).toHaveBeenCalledWith(new SetSelectedNodesAction([]));
});
it('should reset store selection and document list on `reset` event', () => {
it('should reset selection state on `reset` event', () => {
documentListDirective.ngOnInit();
contentManagementServiceMock.reload.next();
contentManagementServiceMock.reset.next();
expect(documentListMock.resetSelection).toHaveBeenCalled();
expect(storeMock.dispatch).toHaveBeenCalledWith(new SetSelectedNodesAction([]));
expect(documentListDirective.selectedNode).toBeNull();
});
});

View File

@ -142,6 +142,7 @@ export class DocumentListDirective implements OnInit, OnDestroy {
}
private reset() {
this.selectedNode = null;
this.documentList.resetSelection();
this.store.dispatch(new SetSelectedNodesAction([]));
}