mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
ensure parameter node id is a folder instance (#166)
This commit is contained in:
committed by
Denys Vuika
parent
92c147fae3
commit
9428913900
@@ -77,7 +77,7 @@ describe('FilesComponent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
node = { id: 'node-id' };
|
||||
node = { id: 'node-id', isFolder: true };
|
||||
page = {
|
||||
list: {
|
||||
entries: ['a', 'b', 'c'],
|
||||
@@ -134,6 +134,17 @@ describe('FilesComponent', () => {
|
||||
|
||||
expect(component.onFetchError).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('if should navigate to parent if node is not a folder', () => {
|
||||
node.isFolder = false;
|
||||
node.parentId = 'parent-id';
|
||||
spyOn(component, 'fetchNode').and.returnValue(Observable.of(node));
|
||||
spyOn(router, 'navigate');
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(router.navigate).toHaveBeenCalledWith([ '/personal-files', 'parent-id' ]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('refresh on events', () => {
|
||||
|
Reference in New Issue
Block a user