mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +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 { discordApprovalNativeRuntime } from "./approval-handler.runtime.js";
|
||||
|
||||
@@ -33,10 +32,7 @@ describe("discordApprovalNativeRuntime", () => {
|
||||
});
|
||||
|
||||
expect(prepared).toEqual({
|
||||
dedupeKey: buildChannelApprovalNativeTargetKey({
|
||||
to: "123456789",
|
||||
threadId: "777888999",
|
||||
}),
|
||||
dedupeKey: "777888999",
|
||||
target: {
|
||||
discordChannelId: "777888999",
|
||||
},
|
||||
|
||||
@@ -19,7 +19,6 @@ import type {
|
||||
PluginApprovalResolvedView,
|
||||
} 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 {
|
||||
ExecApprovalActionDescriptor,
|
||||
@@ -512,7 +511,7 @@ export const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAd
|
||||
? plannedTarget.target.threadId.trim()
|
||||
: plannedTarget.target.to;
|
||||
return {
|
||||
dedupeKey: buildChannelApprovalNativeTargetKey(plannedTarget.target),
|
||||
dedupeKey: destinationId,
|
||||
target: {
|
||||
discordChannelId: destinationId,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user