refactor(outbound): dedupe poll threading + tighten duration semantics

This commit is contained in:
Peter Steinberger
2026-02-14 18:53:23 +01:00
parent f47584fec8
commit 4b9cb46c6e
7 changed files with 85 additions and 33 deletions

View File

@@ -29,4 +29,15 @@ describe("polls", () => {
expect(normalizePollDurationHours(999, { defaultHours: 24, maxHours: 48 })).toBe(48);
expect(normalizePollDurationHours(1, { defaultHours: 24, maxHours: 48 })).toBe(1);
});
it("rejects both durationSeconds and durationHours", () => {
expect(() =>
normalizePollInput({
question: "Q",
options: ["A", "B"],
durationSeconds: 60,
durationHours: 1,
}),
).toThrow(/mutually exclusive/);
});
});