#244 breadcrumb as a separate component (doclist only)

This commit is contained in:
Denys Vuika
2016-06-21 15:51:51 +01:00
parent bf7414fc85
commit e101f22e28
10 changed files with 175 additions and 138 deletions

View File

@@ -70,26 +70,6 @@ describe('DocumentList', () => {
expect(documentList.columns[0]).toBe(column);
});
it('should setup default root for breadcrumb', () => {
documentList.ngOnInit();
expect(documentList.route.length).toBe(1);
expect(documentList.route[0]).toBe(documentList.rootFolder);
});
it('should display custom root path', () => {
spyOn(documentList, 'displayFolderContent').and.stub();
let root = {
name: '<root>',
path: '<path>'
};
documentList.currentFolderPath = root.path;
documentList.rootFolder = root;
documentList.ngOnInit();
expect(documentList.displayFolderContent).toHaveBeenCalledWith(root.path);
});
it('should fetch folder', () => {
let folder = {
'nodeRef': 'workspace://SpacesStore/8bb36efb-c26d-4d2b-9199-ab6922f53c28'
@@ -156,15 +136,6 @@ describe('DocumentList', () => {
expect(action.handler).not.toHaveBeenCalled();
});
it('should update current folder path', () => {
expect(documentList.currentFolderPath).toBe(documentList.rootFolder.path);
let path = '<path>';
documentList.displayFolderContent(path);
expect(documentList.currentFolderPath).toBe(path);
});
it('should give no content actions for empty target', () => {
let actions = documentList.getContentActions(null, 'button');
expect(actions.length).toBe(0);
@@ -270,10 +241,6 @@ describe('DocumentList', () => {
documentList.onItemClick(node);
expect(documentList.displayFolderContent).toHaveBeenCalledWith(path);
let routeEntry = documentList.route.pop();
expect(routeEntry.name).toBe(node.entry.name);
expect(routeEntry.path).toBe(path);
});
it('should not display folder content when no target node provided', () => {