feat: implement tests and coverage reports for KpiCards and scrapeLakes functionality

This commit is contained in:
David Fencl
2026-06-05 23:08:44 +02:00
parent 0030dca448
commit 8193ce818a
37 changed files with 4309 additions and 31 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ const lakes = lakesConfig.map(lake => {
if (data.length > 0) {
// Find latest valid record or just the last record
const lastValidLevelData = [...data].reverse().find(d => d.level !== null && !isNaN(d.level));
const lastValidFlowData = [...data].reverse().find(d => d.flow !== null && !isNaN(d.flow) && d.flow > 0);
const lastValidFlowData = [...data].reverse().find(d => d.flow !== null && !isNaN(d.flow) && d.flow >= 0);
currentLevel = lastValidLevelData ? lastValidLevelData.level : 0;
currentFlow = lastValidFlowData ? lastValidFlowData.flow : 0;