Initial curated Unraid-AppOps-Gateway source from 3bd6f6fee310125bfbb4d4650389a817f498724d

This commit is contained in:
Public Source Publisher committed 2026-10-01 01:35:57 +02:00
commit 1dfbca08a1
528 files changed
+131054

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
const source = readFileSync(new URL("./Overview.tsx", import.meta.url), "utf8");
const appDetailSource = readFileSync(new URL("./AppDetail.tsx", import.meta.url), "utf8");
const systemLoadChartSource = readFileSync(new URL("../lib/systemLoadChartView.ts", import.meta.url), "utf8");
test("overview uses live statistics instead of hardcoded chart data", () => {
assert.doesNotMatch(source, /mockHistoryData|09:00|09:30|Last 3h/);
assert.match(source, /getStatisticsSummary/);
assert.match(source, /buildSystemLoadChartData/);
assert.match(systemLoadChartSource, /cpuHistory/);
assert.match(systemLoadChartSource, /ramHistory/);
assert.match(systemLoadChartSource, /Vlakke trend uit huidige live sample/);
});
test("overview does not show setup-complete cards when there are no setup problems", () => {
assert.doesNotMatch(source, /Coverage plan|Setup voltooid|Live setup is klaar|setup is klaar/i);
assert.match(source, /setupProblems/);
});
test("overview uses independent live queries so one failed source does not blank the route", () => {
assert.match(source, /useQuery/);
assert.match(source, /summaryQuery\.data \?\? null/);
assert.match(source, /appsQuery\.data \?\? \[\]/);
assert.match(source, /\.every\(query => query\.isPending\)/);
});
test("overview refreshes fast metrics separately from connector-heavy intelligence", () => {
assert.match(source, /statistics-summary[\s\S]*refetchInterval: 10_000/);
assert.match(source, /system-summary[\s\S]*refetchInterval: 10_000/);
assert.match(source, /safety-dashboard[\s\S]*refetchInterval: 60_000/);
assert.match(source, /storage-summary[\s\S]*refetchInterval: 60_000/);
assert.match(source, /getAuditLogs\(5\)/);
});
test("overview only shows latest action copy when live summary has one", () => {
assert.match(source, /summary\?\.lastAction \?/);
assert.match(source, /Live status, acties en aandachtspunten staan klaar/);
});
test("overview keeps unresolved cards explicit instead of showing false zero values", () => {
assert.match(source, /appsQuery\.isPending \? "—"/);
assert.match(source, /storageQuery\.isPending \? "—"/);
assert.match(source, /safetyQuery\.isPending \? "—"/);
});
test("app detail resource chart uses live container metrics instead of sample data", () => {
assert.doesNotMatch(appDetailSource, /mockChartData|10:00|Last 30m/);
assert.match(appDetailSource, /resourceChartData/);
assert.match(appDetailSource, /metricPercent/);
});