2017-12-28 17:01:28 +01:00
|
|
|
export const backendSrv = {
|
|
|
|
|
get: jest.fn(),
|
2018-01-11 15:42:45 +01:00
|
|
|
getDashboard: jest.fn(),
|
2018-02-01 13:21:24 +01:00
|
|
|
getDashboardByUid: jest.fn(),
|
2018-02-01 22:32:26 +01:00
|
|
|
getFolderByUid: jest.fn(),
|
2018-01-01 18:54:23 +01:00
|
|
|
post: jest.fn(),
|
2017-12-28 17:01:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function createNavTree(...args) {
|
|
|
|
|
let root = [];
|
|
|
|
|
let node = root;
|
|
|
|
|
for (let arg of args) {
|
|
|
|
|
let child = { id: arg, url: `/url/${arg}`, text: `${arg}-Text`, children: [] };
|
|
|
|
|
node.push(child);
|
|
|
|
|
node = child.children;
|
|
|
|
|
}
|
2018-01-11 15:42:45 +01:00
|
|
|
|
2017-12-28 17:01:28 +01:00
|
|
|
return root;
|
|
|
|
|
}
|