Files
grafana/public/test/mocks/common.ts
2018-02-01 13:21:24 +01:00

19 lines
386 B
TypeScript

export const backendSrv = {
get: jest.fn(),
getDashboard: jest.fn(),
getDashboardByUid: jest.fn(),
post: jest.fn(),
};
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;
}
return root;
}