test: tighten matrix http client request assertion

This commit is contained in:
Shakker
2026-05-10 23:55:45 +01:00
parent fb37c962af
commit ea27bce7e2
@@ -48,18 +48,21 @@ describe("MatrixAuthedHttpClient", () => {
});
expect(result).toEqual({ ok: true });
expect(performMatrixRequestMock).toHaveBeenCalledWith(
expect.objectContaining({
method: "GET",
endpoint: "https://matrix.example.org/_matrix/client/v3/account/whoami",
allowAbsoluteEndpoint: true,
ssrfPolicy: { allowPrivateNetwork: true },
dispatcherPolicy: {
mode: "explicit-proxy",
proxyUrl: "http://proxy.internal:8080",
},
}),
);
expect(performMatrixRequestMock).toHaveBeenCalledWith({
homeserver: "https://matrix.example.org",
accessToken: "token",
method: "GET",
endpoint: "https://matrix.example.org/_matrix/client/v3/account/whoami",
qs: undefined,
body: undefined,
timeoutMs: 5000,
ssrfPolicy: { allowPrivateNetwork: true },
dispatcherPolicy: {
mode: "explicit-proxy",
proxyUrl: "http://proxy.internal:8080",
},
allowAbsoluteEndpoint: true,
});
});
it("returns plain text when response is not JSON", async () => {