Add persistent car performance analytics
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user