test: cover hook deliver default (#533) (thanks @mcinteerj)

This commit is contained in:
Peter Steinberger
2026-01-09 17:34:22 +01:00
parent cac467a2df
commit 40fcfc9479
2 changed files with 11 additions and 0 deletions

View File

@@ -66,6 +66,16 @@ describe("gateway hooks helpers", () => {
expect(ok.value.sessionKey).toBe("hook:fixed");
expect(ok.value.provider).toBe("last");
expect(ok.value.name).toBe("Hook");
expect(ok.value.deliver).toBe(true);
}
const explicitNoDeliver = normalizeAgentPayload(
{ message: "hello", deliver: false },
{ idFactory: () => "fixed" },
);
expect(explicitNoDeliver.ok).toBe(true);
if (explicitNoDeliver.ok) {
expect(explicitNoDeliver.value.deliver).toBe(false);
}
const imsg = normalizeAgentPayload(