fix(telegram): align progress-window tests with rebased core types

Post-rebase onto main, check-test-types/lint failed on our touched test
files (runtime unaffected):
- core's onVerboseProgressVisibility now takes a thunk (isActive: () =>
  boolean); the dispatch test passed a bare boolean. Pass () => true.
- our TelegramDraftStream additions (finalizeToPreview,
  rotateToNewMessageDeferringDelete) are required members; the QA-e2e
  mock streams omitted them. Add both to every mock stream.
- drop a redundant 'as string' cast (oxlint no-unnecessary-type-assertion).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Peter Lindsey
2026-07-03 01:23:57 +08:00
committed by Ayaan Zaidi
parent 9dfa7dc87a
commit b43687d0b5
2 changed files with 10 additions and 2 deletions
@@ -3394,7 +3394,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
// The interim block text never reached the window (neither update nor preview).
const windowTexts = [
...answerDraftStream.update.mock.calls.map((call) => call[0] as string),
...answerDraftStream.update.mock.calls.map((call) => call[0]),
...answerDraftStream.updatePreview.mock.calls.map(
(call) => (call[0] as { text?: string }).text ?? "",
),
@@ -3441,7 +3441,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
const { answerDraftStream } = setupDraftStreams({ answerMessageId: 2001 });
dispatchReplyWithBufferedBlockDispatcher.mockImplementation(
async ({ dispatcherOptions, replyOptions }) => {
replyOptions?.onVerboseProgressVisibility?.(true);
replyOptions?.onVerboseProgressVisibility?.(() => true);
await replyOptions?.onToolStart?.({ name: "exec", phase: "start" });
await dispatcherOptions.deliver({ text: "Done" }, { kind: "final" });
return { queuedFinal: true };
@@ -21,6 +21,8 @@ describe("channel message flows QA e2e", () => {
stop: vi.fn(async () => {}),
messageId: vi.fn(() => 17),
forceNewMessage: vi.fn(),
finalizeToPreview: vi.fn(async () => undefined),
rotateToNewMessageDeferringDelete: vi.fn(() => undefined),
};
}
@@ -40,6 +42,8 @@ describe("channel message flows QA e2e", () => {
stop: vi.fn(async () => {}),
messageId: vi.fn(() => 17),
forceNewMessage: vi.fn(),
finalizeToPreview: vi.fn(async () => undefined),
rotateToNewMessageDeferringDelete: vi.fn(() => undefined),
};
const sendFinal = vi.fn(async () => {
events.push("final");
@@ -88,6 +92,8 @@ describe("channel message flows QA e2e", () => {
stop: vi.fn(async () => {}),
messageId: vi.fn(() => 17),
forceNewMessage: vi.fn(),
finalizeToPreview: vi.fn(async () => undefined),
rotateToNewMessageDeferringDelete: vi.fn(() => undefined),
};
const sendFinal = vi.fn(async () => ({ messageId: "99", chatId: "123" }));
@@ -120,6 +126,8 @@ describe("channel message flows QA e2e", () => {
stop: vi.fn(async () => {}),
messageId: vi.fn(() => 17),
forceNewMessage: vi.fn(),
finalizeToPreview: vi.fn(async () => undefined),
rotateToNewMessageDeferringDelete: vi.fn(() => undefined),
};
await expect(