Files
grafana/public/test/mocks/common.ts

20 lines
415 B
TypeScript
Raw Normal View History

2017-12-28 17:01:28 +01:00
export const backendSrv = {
get: jest.fn(),
getDashboard: jest.fn(),
2018-02-01 13:21:24 +01:00
getDashboardByUid: jest.fn(),
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;
}
2017-12-28 17:01:28 +01:00
return root;
}