diff --git a/packages/doorman-api/tst/integ-local.test.ts b/packages/doorman-api/tst/integ-local.test.ts index 75c714c..03b2c81 100644 --- a/packages/doorman-api/tst/integ-local.test.ts +++ b/packages/doorman-api/tst/integ-local.test.ts @@ -3,6 +3,7 @@ import { waitForService, baseUrl, doorName, buzzerNumber, key, buzzerUrl } from import { DoorStatus } from "../src/types/DoorStatus"; import { StatusResponse } from "../src/functions/api/door/status"; import { sleep } from "bun"; +import { InfoResponseClient } from "../src/functions/api/door/info"; // these tests should only run locally if (process.env.STAGE === 'staging') { @@ -21,6 +22,15 @@ describe("info path works", () => { expect(resp.buzzer).toBe(buzzerNumber); }); + test("unknown info repsonds with a msg", async () => { + const resp = await fetch(baseUrl + `/api/door/info?door=baddoor`); + + expect(resp.status).toBe(404); + const body = await resp.json() as any; + expect(body.msg).toContain("not registered"); + + }) + test("info works from client", async () => { const resp = await fetch(baseUrl + `/api/door/info?buzzer=${buzzerNumber}`).then(res => res.json()) as any;