mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 07:57:40 +00:00
Approvals: align native runtime tests
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { discordApprovalNativeRuntime } from "./approval-handler.runtime.js";
|
import { discordApprovalNativeRuntime } from "./approval-handler.runtime.js";
|
||||||
|
|
||||||
@@ -33,10 +32,7 @@ describe("discordApprovalNativeRuntime", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(prepared).toEqual({
|
expect(prepared).toEqual({
|
||||||
dedupeKey: buildChannelApprovalNativeTargetKey({
|
dedupeKey: "777888999",
|
||||||
to: "123456789",
|
|
||||||
threadId: "777888999",
|
|
||||||
}),
|
|
||||||
target: {
|
target: {
|
||||||
discordChannelId: "777888999",
|
discordChannelId: "777888999",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import type {
|
|||||||
PluginApprovalResolvedView,
|
PluginApprovalResolvedView,
|
||||||
} from "openclaw/plugin-sdk/approval-handler-runtime";
|
} from "openclaw/plugin-sdk/approval-handler-runtime";
|
||||||
import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
|
import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
|
||||||
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
||||||
import type { DiscordExecApprovalConfig, OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
import type { DiscordExecApprovalConfig, OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||||
import type {
|
import type {
|
||||||
ExecApprovalActionDescriptor,
|
ExecApprovalActionDescriptor,
|
||||||
@@ -512,7 +511,7 @@ export const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAd
|
|||||||
? plannedTarget.target.threadId.trim()
|
? plannedTarget.target.threadId.trim()
|
||||||
: plannedTarget.target.to;
|
: plannedTarget.target.to;
|
||||||
return {
|
return {
|
||||||
dedupeKey: buildChannelApprovalNativeTargetKey(plannedTarget.target),
|
dedupeKey: destinationId,
|
||||||
target: {
|
target: {
|
||||||
discordChannelId: destinationId,
|
discordChannelId: destinationId,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user