refactor: move telegram poll visibility out of core

This commit is contained in:
Peter Steinberger
2026-04-27 12:25:51 +01:00
parent 3bc29dd604
commit 7363fb4a44
3 changed files with 69 additions and 27 deletions

View File

@@ -0,0 +1,13 @@
import { describe, expect, it } from "vitest";
import { resolveTelegramPollVisibility } from "./poll-visibility.js";
describe("telegram poll visibility", () => {
it("resolves poll visibility aliases", () => {
expect(resolveTelegramPollVisibility({ pollAnonymous: true })).toBe(true);
expect(resolveTelegramPollVisibility({ pollPublic: true })).toBe(false);
expect(resolveTelegramPollVisibility({})).toBeUndefined();
expect(() => resolveTelegramPollVisibility({ pollAnonymous: true, pollPublic: true })).toThrow(
/mutually exclusive/i,
);
});
});