mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
20 lines
421 B
TypeScript
20 lines
421 B
TypeScript
export const backendSrv = {
|
|
get: jest.fn(),
|
|
getDashboard: jest.fn(),
|
|
getDashboardByUid: jest.fn(),
|
|
getFolderByUid: jest.fn(),
|
|
post: jest.fn(),
|
|
};
|
|
|
|
export function createNavTree(...args) {
|
|
const root = [];
|
|
let node = root;
|
|
for (const arg of args) {
|
|
const child = { id: arg, url: `/url/${arg}`, text: `${arg}-Text`, children: [] };
|
|
node.push(child);
|
|
node = child.children;
|
|
}
|
|
|
|
return root;
|
|
}
|