test(http): preserve wallet error response status

This commit is contained in:
redshift
2026-10-02 17:01:14 +08:00
parent 99f55d3bae
commit 8329eda0fb
+11
View File
@@ -269,3 +269,14 @@ describe("POST /providers/nostr-sync", () => {
expect(res.status).toBe(400);
});
});
describe("wallet errors", () => {
it("maps a WalletHttpError onto its HTTP status", async () => {
const handler = createDaemonRequestHandler({
walletClient: { getMintQuote: async () => null },
} as any);
const res = await call(handler, "GET", "/wallet/receive/bolt11/missing");
expect(res.status).toBe(404);
expect(res.json()).toEqual({ error: "Mint quote not found" });
});
});