mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user