From dbd7ed051adb86b05a08f96bb025674ccf22b411 Mon Sep 17 00:00:00 2001 From: youzini Date: Sat, 30 May 2026 18:39:46 +0000 Subject: [PATCH] test: inject resolveOperationalChatId stub into mobile-status VM context --- tests/mobile-status-regressions.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/mobile-status-regressions.mjs b/tests/mobile-status-regressions.mjs index d82ba24..ef698bb 100644 --- a/tests/mobile-status-regressions.mjs +++ b/tests/mobile-status-regressions.mjs @@ -54,6 +54,18 @@ function createBaseStatusContext() { lastRecallStatus: { text: "待命", meta: "", level: "idle" }, lastStatusToastAt: {}, STATUS_TOAST_THROTTLE_MS: 1500, + getContext() { + return {}; + }, + resolveOperationalChatId(context, graph, explicitChatId = "") { + // VM snippet calls this as a free function (no `this`); derive only from + // arguments so it never depends on per-test getCurrentChatId closures. + return ( + String(explicitChatId || "").trim() || + String(graph?.historyState?.chatId || "").trim() || + "chat-mobile" + ); + }, _panelModule: { updateFloatingBallStatus() {}, },