diff --git a/extensions/telegram/src/bot.create-telegram-bot.test.ts b/extensions/telegram/src/bot.create-telegram-bot.test.ts index 3d9944d15602..fb6af5ce6daa 100644 --- a/extensions/telegram/src/bot.create-telegram-bot.test.ts +++ b/extensions/telegram/src/bot.create-telegram-bot.test.ts @@ -43,7 +43,6 @@ const harness = await import("./bot.create-telegram-bot.test-harness.js"); const pluginStateTestRuntime = await import("openclaw/plugin-sdk/plugin-state-test-runtime"); const configMutation = await import("openclaw/plugin-sdk/config-mutation"); const modelSessionRuntime = await import("openclaw/plugin-sdk/model-session-runtime"); -const sessionStoreRuntime = await import("openclaw/plugin-sdk/session-store-runtime"); const EYES_EMOJI = "\u{1F440}"; const tempStateDirs: string[] = []; let previousStateDir: string | undefined; @@ -5407,15 +5406,14 @@ describe("createTelegramBot", () => { it("shows a permanent rejection when model selection is locked", async () => { createTelegramBot({ token: "tok" }); const callbackHandler = getOnHandler("callback_query"); - const patchSessionEntrySpy = vi - .spyOn(sessionStoreRuntime, "patchSessionEntry") - .mockImplementationOnce(async (params) => { + const getSessionEntrySpy = vi + .spyOn(telegramBotDepsForTest, "getSessionEntry") + .mockImplementationOnce(() => { const entry = { sessionId: "locked-session", updatedAt: Date.now(), modelSelectionLocked: true, }; - await params.update(entry, { existingEntry: entry }); return entry; }); const ctx = makeCallbackRetryContext({ @@ -5427,7 +5425,7 @@ describe("createTelegramBot", () => { try { await expect(callbackHandler(ctx)).resolves.toBeUndefined(); } finally { - patchSessionEntrySpy.mockRestore(); + getSessionEntrySpy.mockRestore(); } expect(editMessageTextSpy).toHaveBeenCalledTimes(1);