common.ts 354 B

1234567891011121314151617
  1. export const backendSrv = {
  2. get: jest.fn(),
  3. getDashboard: jest.fn(),
  4. post: jest.fn(),
  5. };
  6. export function createNavTree(...args) {
  7. let root = [];
  8. let node = root;
  9. for (let arg of args) {
  10. let child = { id: arg, url: `/url/${arg}`, text: `${arg}-Text`, children: [] };
  11. node.push(child);
  12. node = child.children;
  13. }
  14. return root;
  15. }