mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
test: stub channel migration setup surfaces
This commit is contained in:
@@ -88,6 +88,20 @@ vi.mock("../channels/plugins/bundled.js", () => {
|
||||
}
|
||||
|
||||
return {
|
||||
listBundledChannelLegacySessionSurfaces: vi.fn(() => [
|
||||
{
|
||||
isLegacyGroupSessionKey: (key: string) => /^group:.+@g\.us$/i.test(key.trim()),
|
||||
canonicalizeLegacySessionKey: ({ key, agentId }: { key: string; agentId: string }) =>
|
||||
/^group:.+@g\.us$/i.test(key.trim())
|
||||
? `agent:${agentId}:whatsapp:${key.trim().toLowerCase()}`
|
||||
: null,
|
||||
},
|
||||
]),
|
||||
listBundledChannelLegacyStateMigrationDetectors: vi.fn(() => [
|
||||
({ oauthDir }: { oauthDir: string }) => detectWhatsAppLegacyStateMigrations({ oauthDir }),
|
||||
({ cfg, env }: { cfg: OpenClawConfig; env: NodeJS.ProcessEnv }) =>
|
||||
detectTelegramAllowFromMigration({ cfg, env }),
|
||||
]),
|
||||
listBundledChannelSetupPluginsByFeature: vi.fn((feature: string) => {
|
||||
if (feature === "legacySessionSurfaces") {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user