Skip to content

Commit bf49730

Browse files
committed
test(signal): cover unbounded caption chunks
1 parent 94ab783 commit bf49730

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

extensions/signal/src/format.chunking.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,16 @@ describe("splitSignalFormattedText", () => {
296296
});
297297

298298
describe("markdownToSignalTextChunks", () => {
299+
it("treats Infinity as unbounded for media captions", () => {
300+
const markdown = "Here's **another** photo from today's walk.";
301+
302+
const chunks = markdownToSignalTextChunks(markdown, Number.POSITIVE_INFINITY);
303+
304+
expect(chunks).toHaveLength(1);
305+
expect(chunks[0]?.text).toBe("Here's another photo from today's walk.");
306+
expect(chunks[0]?.styles.map((style) => style.style)).toContain("BOLD");
307+
});
308+
299309
describe("link expansion chunk limit", () => {
300310
it("does not exceed chunk limit after link expansion", () => {
301311
// Create text that is close to limit, with a link that will expand

0 commit comments

Comments
 (0)