fix(map): convert actual demand display units

This commit is contained in:
2026-07-17 10:13:50 +08:00
parent d8ee2e1f0c
commit d986e563a6
4 changed files with 54 additions and 12 deletions
+19
View File
@@ -0,0 +1,19 @@
import { FLOW_DISPLAY_UNIT, isLpsFlowProperty, toM3h } from "./units";
describe("flow display units", () => {
it("uses cubic meters per hour as the flow display unit", () => {
expect(FLOW_DISPLAY_UNIT).toBe("m³/h");
});
it("converts L/s values to m³/h", () => {
expect(toM3h(10, "lps")).toBe(36);
expect(toM3h(10, "L/s")).toBe(36);
});
it("recognizes computed properties that arrive from the backend in L/s", () => {
expect(isLpsFlowProperty("flow")).toBe(true);
expect(isLpsFlowProperty("actual_demand")).toBe(true);
expect(isLpsFlowProperty("actualdemand")).toBe(true);
expect(isLpsFlowProperty("pressure")).toBe(false);
});
});