Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: a header bell with the count of firing alerts opens a list of them and a link to Grafana

This commit is contained in:
iris 2026-11-21 15:01:16 +01:00
commit 70e5de5571

View file

@ -6,6 +6,7 @@ import { test } from "node:test";
import {
activeSinceMs,
alertKey,
alertsLabel,
firingAlerts,
listedAlerts,
} from "../src/pages/alerts.ts";
@ -87,3 +88,8 @@ test("instances of one rule get different keys, whatever the label order", () =>
assert.equal(alertKey(a), alertKey(b));
assert.notEqual(alertKey(a), alertKey(c));
});
test("the alert button's name counts the firing alerts", () => {
assert.equal(alertsLabel(1), "1 alert firing");
assert.equal(alertsLabel(3), "3 alerts firing");
});