mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 11:40:43 +00:00
test: tighten synology chat tls assertions
This commit is contained in:
@@ -121,7 +121,12 @@ describe("Synology Chat TLS verification defaults", () => {
|
||||
mockSuccessResponse();
|
||||
await settleTimers(invoke());
|
||||
const httpsRequest = vi.mocked(https.request);
|
||||
expect(httpsRequest.mock.calls[0]?.[1]).toMatchObject({ rejectUnauthorized: true });
|
||||
const firstCall = httpsRequest.mock.calls[0];
|
||||
expect(firstCall).toBeDefined();
|
||||
if (!firstCall) {
|
||||
throw new Error("expected Synology Chat HTTPS request");
|
||||
}
|
||||
expect(firstCall[1]).toMatchObject({ rejectUnauthorized: true });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -153,7 +158,12 @@ describe("sendMessage", () => {
|
||||
mockSuccessResponse();
|
||||
await settleTimers(sendMessage("https://nas.example.com/incoming", "Hello", undefined, true));
|
||||
const httpsRequest = vi.mocked(https.request);
|
||||
expect(httpsRequest.mock.calls[0]?.[1]).toMatchObject({ rejectUnauthorized: false });
|
||||
const firstCall = httpsRequest.mock.calls[0];
|
||||
expect(firstCall).toBeDefined();
|
||||
if (!firstCall) {
|
||||
throw new Error("expected Synology Chat HTTPS request");
|
||||
}
|
||||
expect(firstCall[1]).toMatchObject({ rejectUnauthorized: false });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -376,6 +386,11 @@ describe("fetchChatUsers", () => {
|
||||
await fetchChatUsers(freshUrl);
|
||||
|
||||
const httpsGet = vi.mocked(https.get);
|
||||
expect(httpsGet.mock.calls[0]?.[1]).toMatchObject({ rejectUnauthorized: true });
|
||||
const firstCall = httpsGet.mock.calls[0];
|
||||
expect(firstCall).toBeDefined();
|
||||
if (!firstCall) {
|
||||
throw new Error("expected Synology Chat HTTPS get");
|
||||
}
|
||||
expect(firstCall[1]).toMatchObject({ rejectUnauthorized: true });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user