diff --git a/frontend/components/account/AccountCenter.tsx b/frontend/components/account/AccountCenter.tsx index 4ceecd10..1f0c0284 100644 --- a/frontend/components/account/AccountCenter.tsx +++ b/frontend/components/account/AccountCenter.tsx @@ -219,10 +219,7 @@ const TELEGRAM_GROUP_URL = String( const TELEGRAM_BOT_URL = String( process.env.NEXT_PUBLIC_TELEGRAM_BOT_URL || "https://t.me/WeatherQuant_bot", ).trim(); -const TELEGRAM_MARKET_CHANNEL_URL = String( - process.env.NEXT_PUBLIC_TELEGRAM_MARKET_CHANNEL_URL || - "https://t.me/+hGAk7JsjtdhiOTUx", -).trim(); +const TELEGRAM_MARKET_CHANNEL_URL = "https://t.me/+hGAk7JsjtdhiOTUx"; const SUBSCRIPTION_HELP_HREF = "/subscription-help"; let walletConnectProviderCache: EvmProvider | null = null; diff --git a/tests/test_bot_basic_handler.py b/tests/test_bot_basic_handler.py index 7269e0b0..68b838fc 100644 --- a/tests/test_bot_basic_handler.py +++ b/tests/test_bot_basic_handler.py @@ -9,11 +9,31 @@ class DummyBot: self.replies = [] self.sent_messages = [] - def reply_to(self, message, text, parse_mode=None): - self.replies.append({"text": text, "parse_mode": parse_mode, "chat_id": message.chat.id}) + def reply_to(self, message, text, parse_mode=None, disable_web_page_preview=None): + self.replies.append( + { + "text": text, + "parse_mode": parse_mode, + "chat_id": message.chat.id, + "disable_web_page_preview": disable_web_page_preview, + } + ) - def send_message(self, chat_id, text, parse_mode=None): # pragma: no cover - self.sent_messages.append({"chat_id": chat_id, "text": text, "parse_mode": parse_mode}) + def send_message( + self, + chat_id, + text, + parse_mode=None, + disable_web_page_preview=None, + ): # pragma: no cover + self.sent_messages.append( + { + "chat_id": chat_id, + "text": text, + "parse_mode": parse_mode, + "disable_web_page_preview": disable_web_page_preview, + } + ) def message_handler(self, *args, **kwargs): # pragma: no cover - decorator stub def _decorator(func): @@ -79,6 +99,10 @@ def test_basic_handler_markets_returns_summary(monkeypatch): "src.utils.telegram_push.build_market_monitor_digest", lambda config, slot_label="当前概览", top_n=None, force_refresh=False: "MARKET DIGEST", ) + monkeypatch.setattr( + "src.utils.telegram_push.load_cached_market_monitor_digest", + lambda: "", + ) monkeypatch.setattr( "src.bot.handlers.basic.threading.Thread", lambda target, name=None, daemon=None: SimpleNamespace(start=target),