#159 improved error reporting for document-list (#1180)

- expose ‘error’ event
- change path only on successful navigation
- extend demo shell with error handling and reporting
- additional unit tests for document-list
This commit is contained in:
Denys Vuika
2016-11-30 14:52:06 +00:00
committed by Eugenio Romano
parent da70a72bba
commit 7eab89c5ef
8 changed files with 171 additions and 60 deletions

View File

@@ -85,15 +85,18 @@ describe('DocumentListBreadcrumb', () => {
component.onRoutePathClick(node, null);
});
it('should update document list on click', () => {
it('should update document list on click', (done) => {
let documentList = new DocumentList(null, null, null);
spyOn(documentList, 'displayFolderContent').and.stub();
spyOn(documentList, 'displayFolderContent').and.returnValue(Promise.resolve());
let node = <PathNode> { name: 'name', path: '/path' };
component.target = documentList;
component.onRoutePathClick(node, null);
expect(documentList.currentFolderPath).toBe(node.path);
setTimeout(() => {
expect(documentList.currentFolderPath).toBe(node.path);
done();
}, 0);
});
it('should do nothing for same path', () => {