feat(web): app shell, library, entry detail

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Lucas Winther
2026-10-30 21:37:56 +01:00
co-authored by Claude Opus 5.5
parent 70bc6c36d3
commit 439d138967
16 changed files with 1743 additions and 3 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ describe("request", () => {
headers: { "content-type": "application/json" },
}),
);
const err = await request("POST", "entries/quick", { body: { title: "" }, fetchImpl: fn }).catch((e) => e);
const err = (await request("POST", "entries/quick", { body: { title: "" }, fetchImpl: fn }).catch((e: unknown) => e)) as ApiError;
expect(err).toBeInstanceOf(ApiError);
expect(err.code).toBe("validation");
expect(err.status).toBe(400);
@@ -74,7 +74,7 @@ describe("request", () => {
test("a non-JSON error still becomes an ApiError", async () => {
const { fn } = fakeFetch(new Response("<html>Bad gateway</html>", { status: 502 }));
const err = await request("GET", "me", { fetchImpl: fn }).catch((e) => e);
const err = (await request("GET", "me", { fetchImpl: fn }).catch((e: unknown) => e)) as ApiError;
expect(err).toBeInstanceOf(ApiError);
expect(err.code).toBe("http_502");
expect(err.status).toBe(502);
@@ -84,7 +84,7 @@ describe("request", () => {
const { fn } = fakeFetch(() => {
throw new TypeError("fetch failed");
});
const err = await request("GET", "me", { fetchImpl: fn }).catch((e) => e);
const err = (await request("GET", "me", { fetchImpl: fn }).catch((e: unknown) => e)) as ApiError;
expect(err).toBeInstanceOf(ApiError);
expect(err.code).toBe("network");
expect(err.status).toBe(0);