From 74b5b97f6245defdeedc12d7d8e8a367bdd4ab25 Mon Sep 17 00:00:00 2001 From: Mason Date: Thu, 9 Apr 2026 09:38:31 +0800 Subject: [PATCH] tests: reset discord native-command seams in model picker (#63267) --- .../src/monitor/native-command.model-picker.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extensions/discord/src/monitor/native-command.model-picker.test.ts b/extensions/discord/src/monitor/native-command.model-picker.test.ts index 225271e1327..f9078c00467 100644 --- a/extensions/discord/src/monitor/native-command.model-picker.test.ts +++ b/extensions/discord/src/monitor/native-command.model-picker.test.ts @@ -3,6 +3,7 @@ import * as commandRegistryModule from "openclaw/plugin-sdk/command-auth"; import type { ChatCommandDefinition, CommandArgsParsing } from "openclaw/plugin-sdk/command-auth"; import type { ModelsProviderData } from "openclaw/plugin-sdk/command-auth"; import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; +import * as pluginRuntimeModule from "openclaw/plugin-sdk/plugin-runtime"; import * as dispatcherModule from "openclaw/plugin-sdk/reply-dispatch-runtime"; import * as globalsModule from "openclaw/plugin-sdk/runtime-env"; import * as commandTextModule from "openclaw/plugin-sdk/text-runtime"; @@ -10,6 +11,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import * as modelPickerPreferencesModule from "./model-picker-preferences.js"; import * as modelPickerModule from "./model-picker.js"; import { createModelsProviderData as createBaseModelsProviderData } from "./model-picker.test-utils.js"; +import * as nativeCommandRouteModule from "./native-command-route.js"; import { replyWithDiscordModelPickerProviders } from "./native-command-ui.js"; import { __testing as nativeCommandTesting, @@ -256,9 +258,14 @@ describe("Discord model picker interactions", () => { beforeEach(() => { vi.useRealTimers(); vi.restoreAllMocks(); + nativeCommandTesting.setMatchPluginCommand(pluginRuntimeModule.matchPluginCommand); + nativeCommandTesting.setExecutePluginCommand(pluginRuntimeModule.executePluginCommand); nativeCommandTesting.setDispatchReplyWithDispatcher( dispatcherModule.dispatchReplyWithDispatcher, ); + nativeCommandTesting.setResolveDiscordNativeInteractionRouteState( + nativeCommandRouteModule.resolveDiscordNativeInteractionRouteState, + ); }); afterEach(() => {