test: stabilize rebased auto-reply command checks

This commit is contained in:
Peter Steinberger
2026-04-03 23:10:07 +01:00
parent 9004ef65df
commit 3d2734185b
2 changed files with 13 additions and 17 deletions

View File

@@ -12,11 +12,7 @@ import {
readChannelAllowFromStore,
removeChannelAllowFromStoreEntry,
} from "../../pairing/pairing-store.js";
import {
DEFAULT_ACCOUNT_ID,
normalizeAccountId,
normalizeOptionalAccountId,
} from "../../routing/session-key.js";
import { DEFAULT_ACCOUNT_ID, normalizeOptionalAccountId } from "../../routing/session-key.js";
import { normalizeStringEntries } from "../../shared/string-normalization.js";
import {
rejectNonOwnerCommand,

View File

@@ -949,9 +949,9 @@ describe("/approve command", () => {
...telegramCommandTestPlugin,
config: {
...telegramCommandTestPlugin.config,
defaultAccountId: (cfg) =>
((cfg.channels?.telegram as { defaultAccount?: string } | undefined)?.defaultAccount ??
DEFAULT_ACCOUNT_ID),
defaultAccountId: (cfg: OpenClawConfig) =>
(cfg.channels?.telegram as { defaultAccount?: string } | undefined)
?.defaultAccount ?? DEFAULT_ACCOUNT_ID,
},
},
source: "test",
@@ -1839,9 +1839,9 @@ describe("handleCommands /config configWrites gating", () => {
...telegramCommandTestPlugin,
config: {
...telegramCommandTestPlugin.config,
defaultAccountId: (cfg) =>
((cfg.channels?.telegram as { defaultAccount?: string } | undefined)?.defaultAccount ??
DEFAULT_ACCOUNT_ID),
defaultAccountId: (cfg: OpenClawConfig) =>
(cfg.channels?.telegram as { defaultAccount?: string } | undefined)
?.defaultAccount ?? DEFAULT_ACCOUNT_ID,
},
},
},
@@ -2179,9 +2179,9 @@ describe("handleCommands /allowlist", () => {
...telegramCommandTestPlugin,
config: {
...telegramCommandTestPlugin.config,
defaultAccountId: (cfg) =>
((cfg.channels?.telegram as { defaultAccount?: string } | undefined)?.defaultAccount ??
DEFAULT_ACCOUNT_ID),
defaultAccountId: (cfg: OpenClawConfig) =>
(cfg.channels?.telegram as { defaultAccount?: string } | undefined)
?.defaultAccount ?? DEFAULT_ACCOUNT_ID,
},
},
},
@@ -2251,9 +2251,9 @@ describe("handleCommands /allowlist", () => {
...telegramCommandTestPlugin,
config: {
...telegramCommandTestPlugin.config,
defaultAccountId: (cfg) =>
((cfg.channels?.telegram as { defaultAccount?: string } | undefined)?.defaultAccount ??
DEFAULT_ACCOUNT_ID),
defaultAccountId: (cfg: OpenClawConfig) =>
(cfg.channels?.telegram as { defaultAccount?: string } | undefined)
?.defaultAccount ?? DEFAULT_ACCOUNT_ID,
},
},
},