mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 22:02:16 +00:00
test(dawarich): cover the daily values, the refusals and the backup ends
A stub Dawarich instance on the loopback interface drives the shipped routes and the sync against real SQL. Unit tests pin the parsers, the time-away arithmetic, the origin grant, the travel runs, the places route's no-write rule, the backup pair and the schema's no-location rule.
This commit is contained in:
1 parent
b838ed4403
commit
b99bcaeec6
2 files changed
+518
-2
No files matched your search
@@ -92,7 +92,6 @@ describe("GET /api/dawarich/places", () => {
|
||||
]);
|
||||
const res = (await GET(
|
||||
new NextRequest("http://localhost/api/dawarich/places?q=o"),
|
||||
undefined as never,
|
||||
)) as Response;
|
||||
expect(res.status).toBe(200);
|
||||
const body = await res.json();
|
||||
@@ -112,7 +111,6 @@ describe("GET /api/dawarich/places", () => {
|
||||
fetchPlacesMock.mockRejectedValue(new Error("ECONNREFUSED"));
|
||||
const res = (await GET(
|
||||
new NextRequest("http://localhost/api/dawarich/places"),
|
||||
undefined as never,
|
||||
)) as Response;
|
||||
expect(res.status).toBe(502);
|
||||
expect((await res.json()).meta.errorCode).toBe("dawarich.unreachable");
|
||||
|
||||
Reference in new issue
Block a user