neue Testfälle

This commit is contained in:
ChK
2026-04-01 17:10:33 +02:00
parent 66ce3a2bfe
commit 09b2b70efe
18 changed files with 664 additions and 7 deletions

View File

@@ -42,13 +42,12 @@ describe("calculate() Snapshot Tests", () => {
snapshotFile = "snapshot_video0_1774805028717_two_cam.csv";
await calculate();
var result = await calculate();
expect(global.fetch).toHaveBeenCalledWith("/api/latest-snapshot");
const logValue = document.getElementById("analysis-log").value;
expect(logValue).toMatch(/Starte Berechnung/);
expect(logValue).toMatch(/CSV-Daten geladen/);
// Problem: (zMotor = -137.28° = -2.3960 rad) aus roll_deg von ID = 226
//console.log("Berechnungsergebnis:", result.features["forearm.angleZ"].valueDeg);
});
@@ -60,10 +59,40 @@ describe("calculate() Snapshot Tests", () => {
expect(global.fetch).toHaveBeenCalledWith("/api/latest-snapshot");
const logValue = document.getElementById("analysis-log").value;
console.log("Log Value:", logValue);
//const logValue = document.getElementById("analysis-log").value;
//console.log("Log Value:", logValue);
//expect(logValue).toMatch(/Starte Berechnung/);
//expect(logValue).toMatch(/CSV-Daten geladen/);
});
test("Snapshot 1775053356508 wird korrekt geladen. Hatte in der Vergangenheit Fehler", async () => {
snapshotFile = "snapshot_video0_1775053356508_two_cam.csv";
await calculate();
expect(global.fetch).toHaveBeenCalledWith("/api/latest-snapshot");
//expect(logValue).toMatch(/Starte Berechnung/);
//expect(logValue).toMatch(/CSV-Daten geladen/);
});
test("Snapshot video0_1775055007798 wird korrekt geladen. Hatte in der Vergangenheit Fehler", async () => {
snapshotFile = "snapshot_video0_1775055007798_two_cam.csv";
var result =await calculate();
expect(global.fetch).toHaveBeenCalledWith("/api/latest-snapshot");
var valueDeg = result.features["forearm.angleZ"].valueDeg
expect(valueDeg).toBeCloseTo(0, 10); // Erwartet ca. -137.28° mit 1 Dezimalstelle Genauigkeit
//expect(logValue).toMatch(/Starte Berechnung/);
//expect(logValue).toMatch(/CSV-Daten geladen/);
});
});