fix: assert sendDocument with config.storageChatId to match dynamic mock env in CI

This commit is contained in:
MythEclipse
2026-05-18 08:54:24 +07:00
parent 910d29d5b9
commit ed88069e60
+2 -1
View File
@@ -1,6 +1,7 @@
// @ts-nocheck // @ts-nocheck
import { afterEach, beforeEach, describe, expect, it, mock, spyOn } from 'bun:test'; import { afterEach, beforeEach, describe, expect, it, mock, spyOn } from 'bun:test';
import logger from '../src/utils/logger'; import logger from '../src/utils/logger';
import { config } from '../src/env';
// Mock Telegraf and fetch // Mock Telegraf and fetch
mock.module('telegraf', () => { mock.module('telegraf', () => {
@@ -88,7 +89,7 @@ describe('Telegram API Utilities', () => {
const result = await forwardToStorage(chunk, fileName, true); const result = await forwardToStorage(chunk, fileName, true);
expect(bot.telegram.sendDocument).toHaveBeenCalledWith( expect(bot.telegram.sendDocument).toHaveBeenCalledWith(
-1003996572954, config.storageChatId,
{ source: chunk, filename: fileName }, { source: chunk, filename: fileName },
{ caption: `📁 ${fileName}` }, { caption: `📁 ${fileName}` },
); );