test: type logout audit fetch mock
Generic Container CI/CD / test-build-publish (push) Successful in 1m1s
Frontend CI/CD v2 / build-test-publish-and-deploy (push) Successful in 1m1s

This commit is contained in:
2026-09-09 15:07:45 +08:00
parent bad8769000
commit b04378397c
+5 -2
View File
@@ -2,12 +2,15 @@ import { completeLogout, reportLogoutAudit } from "./logoutFlow";
describe("reportLogoutAudit", () => { describe("reportLogoutAudit", () => {
it("starts an authenticated keepalive request", async () => { it("starts an authenticated keepalive request", async () => {
const fetcher = jest.fn(async () => ({ ok: true }) as Response); const fetcher = jest.fn(
async (_input: RequestInfo | URL, _init?: RequestInit) =>
({ ok: true }) as Response,
);
await reportLogoutAudit({ await reportLogoutAudit({
endpoint: "https://server.example/api/v1/audit-events", endpoint: "https://server.example/api/v1/audit-events",
accessToken: "access-token", accessToken: "access-token",
fetcher, fetcher: fetcher as typeof fetch,
}); });
expect(fetcher).toHaveBeenCalledTimes(1); expect(fetcher).toHaveBeenCalledTimes(1);