@@ -330,6 +330,26 @@ describe("resolveTextChunkLimit", () => {
|
330 | 330 | options: undefined, |
331 | 331 | expected: 4000, |
332 | 332 | }, |
| 333 | +{ |
| 334 | +name: "honors webchat textChunkLimit override from config", |
| 335 | +cfg: { |
| 336 | +channels: { |
| 337 | +webchat: { textChunkLimit: 16000 }, |
| 338 | +}, |
| 339 | +}, |
| 340 | +provider: "webchat" as const, |
| 341 | +accountId: undefined, |
| 342 | +options: undefined, |
| 343 | +expected: 16000, |
| 344 | +}, |
| 345 | +{ |
| 346 | +name: "falls back to default when webchat has no override", |
| 347 | +cfg: { channels: {} }, |
| 348 | +provider: "webchat" as const, |
| 349 | +accountId: undefined, |
| 350 | +options: undefined, |
| 351 | +expected: 4000, |
| 352 | +}, |
333 | 353 | ] as const)("$name", ({ cfg, provider, accountId, options, expected }) => { |
334 | 354 | expect(resolveTextChunkLimit(cfg as never, provider, accountId, options)).toBe(expected); |
335 | 355 | }); |
@@ -584,6 +604,12 @@ describe("resolveChunkMode", () => {
|
584 | 604 | { cfg: providerCfg, provider: "discord", accountId: undefined, expected: "length" }, |
585 | 605 | { cfg: accountCfg, provider: "slack", accountId: "primary", expected: "newline" }, |
586 | 606 | { cfg: accountCfg, provider: "slack", accountId: "other", expected: "length" }, |
| 607 | +{ |
| 608 | +cfg: { channels: { webchat: { chunkMode: "newline" as const } } }, |
| 609 | +provider: "webchat", |
| 610 | +accountId: undefined, |
| 611 | +expected: "newline", |
| 612 | +}, |
587 | 613 | ] as const)( |
588 | 614 | "resolves default/provider/account/internal chunk mode for $provider $accountId", |
589 | 615 | ({ cfg, provider, accountId, expected }) => { |
|