[ADF-2304] Add option to Content Node Selector to transform the breadcrumb folder node (#2952)

* [ADF-2304] Add option to Content Node Selector to transform the breadcrumb folder node

* [ADF-2304] update documentation with recent changes

* [ADF-2304] added example of using the breadcrumbTransform
This commit is contained in:
suzanadirla
2018-02-19 19:27:55 +02:00
committed by Eugenio Romano
parent 6b980edcf5
commit 6d0bab9278
7 changed files with 90 additions and 4 deletions

View File

@@ -260,6 +260,36 @@ describe('ContentNodeSelectorComponent', () => {
done();
}, 300);
});
it('should keep breadcrumb\'s folderNode unchanged if breadcrumbTransform is NOT defined', (done) => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(component.breadcrumbTransform).toBeNull();
const breadcrumb = fixture.debugElement.query(By.directive(DropdownBreadcrumbComponent));
expect(breadcrumb.componentInstance.folderNode).toBe(expectedDefaultFolderNode);
done();
});
});
it('should make changes to breadcrumb\'s folderNode if breadcrumbTransform is defined', (done) => {
const transformedFolderNode = <MinimalNodeEntryEntity> { path: { elements: [{id: 'testId', name: 'testName'}] } };
component.breadcrumbTransform = (() => {
return transformedFolderNode;
});
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(component.breadcrumbTransform).not.toBeNull();
const breadcrumb = fixture.debugElement.query(By.directive(DropdownBreadcrumbComponent));
expect(breadcrumb.componentInstance.folderNode).toBe(transformedFolderNode);
done();
});
});
});
describe('Search functionality', () => {