-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.test.js
More file actions
35 lines (26 loc) · 1 KB
/
Copy pathbuild.test.js
File metadata and controls
35 lines (26 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const fs = require("fs");
const DashboardBuilder = require("./src/lib/DashboardBuilder");
const builder = new DashboardBuilder()
function getDashboard(dashboard) {
const options = {
table: "basicrum_friends_webperf_rum_events",
datasourceUid: "A0Wl5Mc4z",
filterMap: {
"hosts":"testHosts",
},
}
builder.build(dashboard, options);
return JSON.parse(fs.readFileSync(`./build/dashboards/${dashboard}.json`, { encoding: "utf8", flag: "r" }));
}
test("Test General dashboard should be as expected", () => {
const generalDashboard = getDashboard("General");
expect(34).toBe(generalDashboard.panels.length);
});
test("Test Metrics dashboard should be as expected", () => {
const metricsDashboard = getDashboard("Metrics");
expect(4).toBe(metricsDashboard.panels.length);
});
test("Test Summary dashboard should be as expected", () => {
const summaryDashboard = getDashboard("Summary");
expect(14).toBe(summaryDashboard.panels.length);
});