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.ngOnChanges({'folderNode': change});
|
||||
|
||||
console.log(component.route);
|
||||
expect(component.route[0].name).toBe('default');
|
||||
});
|
||||
|
||||
|
@@ -54,15 +54,16 @@ export class BreadcrumbComponent implements OnChanges {
|
||||
name: node.name
|
||||
});
|
||||
|
||||
this.checkRoot(route);
|
||||
if (this.root) {
|
||||
route = this.checkRoot(route);
|
||||
}
|
||||
|
||||
this.route = route;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private checkRoot(route) {
|
||||
if (this.root) {
|
||||
private checkRoot(route: PathElementEntity[]): PathElementEntity[] {
|
||||
let isRoot = false;
|
||||
route = route.filter((currentElement) => {
|
||||
if (currentElement.name === this.root) {
|
||||
@@ -77,7 +78,6 @@ export class BreadcrumbComponent implements OnChanges {
|
||||
name: this.root
|
||||
});
|
||||
}
|
||||
}
|
||||
return route;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user