mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
fix breadcrumb test
This commit is contained in:
@@ -61,7 +61,6 @@ describe('Breadcrumb', () => {
|
|||||||
component.root = 'default';
|
component.root = 'default';
|
||||||
component.ngOnChanges({'folderNode': change});
|
component.ngOnChanges({'folderNode': change});
|
||||||
|
|
||||||
console.log(component.route);
|
|
||||||
expect(component.route[0].name).toBe('default');
|
expect(component.route[0].name).toBe('default');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -54,15 +54,16 @@ export class BreadcrumbComponent implements OnChanges {
|
|||||||
name: node.name
|
name: node.name
|
||||||
});
|
});
|
||||||
|
|
||||||
this.checkRoot(route);
|
if (this.root) {
|
||||||
|
route = this.checkRoot(route);
|
||||||
|
}
|
||||||
|
|
||||||
this.route = route;
|
this.route = route;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkRoot(route) {
|
private checkRoot(route: PathElementEntity[]): PathElementEntity[] {
|
||||||
if (this.root) {
|
|
||||||
let isRoot = false;
|
let isRoot = false;
|
||||||
route = route.filter((currentElement) => {
|
route = route.filter((currentElement) => {
|
||||||
if (currentElement.name === this.root) {
|
if (currentElement.name === this.root) {
|
||||||
@@ -77,7 +78,6 @@ export class BreadcrumbComponent implements OnChanges {
|
|||||||
name: this.root
|
name: this.root
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return route;
|
return route;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user