Add persistent car performance analytics

This commit is contained in:
2026-07-31 22:44:51 +02:00
parent 0e4ce931ec
commit 6998e8bdb7
12 changed files with 916 additions and 29 deletions
+8
View File
@@ -255,6 +255,8 @@ describe("authentication boundary", () => {
expect((await app.inject({ method: "GET", url: "/api/adb/packages" })).statusCode).toBe(401);
expect((await app.inject({ method: "GET", url: "/api/adb/shortcuts" })).statusCode).toBe(401);
expect((await app.inject({ method: "GET", url: "/api/car/telemetry" })).statusCode).toBe(401);
expect((await app.inject({ method: "GET", url: "/api/car/history" })).statusCode).toBe(401);
expect((await app.inject({ method: "GET", url: "/api/car/statistics" })).statusCode).toBe(401);
const token = await csrf(app);
await setup(app, token);
@@ -268,6 +270,12 @@ describe("authentication boundary", () => {
const cookie = `${CSRF_COOKIE}=${token}; ${SESSION_COOKIE}=${session}`;
const headers = { ...mutationHeaders(token), cookie };
const history = await app.inject({ method: "GET", url: "/api/car/history?period=24h", headers: { cookie } });
expect(history.statusCode).toBe(200);
expect(history.json()).toMatchObject({ period: "24h", points: [] });
const invalidPeriod = await app.inject({ method: "GET", url: "/api/car/history?period=forever", headers: { cookie } });
expect(invalidPeriod.statusCode).toBe(400);
const invalid = await app.inject({
method: "POST",
url: "/api/adb/shortcuts",