mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tech: progress on react pages
This commit is contained in:
14
public/test/mocks/common.ts
Normal file
14
public/test/mocks/common.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export const backendSrv = {
|
||||
get: 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;
|
||||
}
|
||||
Reference in New Issue
Block a user