Page: Pages that have hideFromBreadcrumbs set to true should not be added to page Title (#56596)

* Page: Pages that have hideFromBreadcrumbs set to true should not be added to page Title

* Updated test
This commit is contained in:
Torkel Ödegaard
2022-10-10 12:47:04 +02:00
committed by GitHub
parent d405f3a877
commit 462f6b7797
4 changed files with 31 additions and 13 deletions

View File

@@ -30,14 +30,16 @@ describe('buildPluginSectionNav', () => {
children: [app1],
};
const home = {
id: HOME_NAV_ID,
text: 'Home',
};
const adminSection: NavModelItem = {
text: 'Admin',
id: 'admin',
children: [],
parentItem: {
id: HOME_NAV_ID,
text: 'Home',
},
parentItem: home,
};
const standalonePluginPage = {
@@ -54,6 +56,7 @@ describe('buildPluginSectionNav', () => {
apps: appsSection,
[app1.id!]: appsSection.children[0],
[standalonePluginPage.id]: standalonePluginPage,
[HOME_NAV_ID]: home,
};
it('Should return pluginNav if topnav is disabled', () => {
@@ -107,9 +110,7 @@ describe('buildPluginSectionNav', () => {
it('Should not throw error just return a root nav model without children for plugins that dont exist in navtree', () => {
config.featureToggles.topnav = true;
const result = buildPluginSectionNav({} as HistoryLocation, pluginNav, navIndex, 'app3');
expect(result?.main.id).toBe('root-plugin-page');
expect(result?.main.hideFromBreadcrumbs).toBe(true);
expect(result?.main.children?.length).toBe(0);
expect(result?.main.id).toBe(HOME_NAV_ID);
});
it('Should throw error if app has no section', () => {