mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TopNav: Fixes to page and plugin page handling (#56278)
* Added labels * App page fixes * Switch to switch * Fixing sort position for Apps
This commit is contained in:
@@ -10,6 +10,7 @@ describe('buildPluginSectionNav', () => {
|
||||
const app1: NavModelItem = {
|
||||
text: 'App1',
|
||||
id: 'plugin-page-app1',
|
||||
url: '/a/plugin1',
|
||||
children: [
|
||||
{
|
||||
text: 'page1',
|
||||
@@ -74,6 +75,18 @@ describe('buildPluginSectionNav', () => {
|
||||
expect(result?.node.text).toBe('page2');
|
||||
});
|
||||
|
||||
it('Should set app section to active', () => {
|
||||
config.featureToggles.topnav = true;
|
||||
const result = buildPluginSectionNav(
|
||||
{ pathname: '/a/plugin1', search: '' } as HistoryLocation,
|
||||
null,
|
||||
navIndex,
|
||||
'app1'
|
||||
);
|
||||
expect(result?.main.children![0].active).toBe(true);
|
||||
expect(result?.node.text).toBe('App1');
|
||||
});
|
||||
|
||||
it('Should handle standalone page', () => {
|
||||
config.featureToggles.topnav = true;
|
||||
const result = buildPluginSectionNav(
|
||||
|
||||
Reference in New Issue
Block a user