惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
F
Full Disclosure
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Tailwind CSS Blog
Microsoft Security Blog
Microsoft Security Blog
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
K
Kaspersky official blog
Hugging Face - Blog
Hugging Face - Blog
D
DataBreaches.Net
P
Proofpoint News Feed
Cisco Talos Blog
Cisco Talos Blog
NISL@THU
NISL@THU
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
美团技术团队
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Martin Fowler
Martin Fowler
L
Lohrmann on Cybersecurity
Know Your Adversary
Know Your Adversary
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
T
Threatpost
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
L
LangChain Blog
Blog — PlanetScale
Blog — PlanetScale
Recorded Future
Recorded Future
C
Cisco Blogs
S
SegmentFault 最新的问题
Cyberwarzone
Cyberwarzone
GbyAI
GbyAI
IT之家
IT之家
S
Schneier on Security
L
LINUX DO - 热门话题
T
Tenable Blog
T
The Exploit Database - CXSecurity.com
MyScale Blog
MyScale Blog
P
Privacy & Cybersecurity Law Blog
Google Online Security Blog
Google Online Security Blog
T
Threat Research - Cisco Blogs

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
perf(slack): narrow runtime-setter + lazy-load 4 modules + narrow 2 S… · openclaw/openclaw@2013855
amknight · 2026-04-22 · via Recent Commits to openclaw:main

@@ -0,0 +1,318 @@

1+

// Regression tests for the lazy-loading boundaries introduced for Slack

2+

// startup-perf work (see PR #69317). Each test asserts both:

3+

// - that the lazy module is reached (call mocks fire), and

4+

// - that the inputs forwarded into the lazy module are correct, and

5+

// - that the lazy module's return value is propagated back through the

6+

// plugin surface unchanged.

7+

//

8+

// Together these guard against:

9+

// - dynamic-import path/specifier drift on cold paths,

10+

// - silent contract drift between the channel and its lazy modules,

11+

// - and accidental loss of the perf intent (re-introducing eager imports

12+

// without updating the seam).

13+14+

import { beforeEach, describe, expect, it, vi } from "vitest";

15+

import { slackPlugin } from "./channel.js";

16+

import type { OpenClawConfig } from "./runtime-api.js";

17+

import { setSlackRuntime } from "./runtime.js";

18+19+

// --- Hoisted mocks for lazy seams ------------------------------------------------

20+21+

const collectAuditFindingsMock = vi.hoisted(() => vi.fn());

22+

const fetchSlackScopesMock = vi.hoisted(() => vi.fn());

23+

const resolveTargetsWithOptionalTokenMock = vi.hoisted(() => vi.fn());

24+

const buildPassiveProbedChannelStatusSummaryMock = vi.hoisted(() => vi.fn());

25+

vi.mock("./security-audit.js", () => ({

26+

collectSlackSecurityAuditFindings: collectAuditFindingsMock,

27+

}));

28+29+

vi.mock("./scopes.js", () => ({

30+

fetchSlackScopes: fetchSlackScopesMock,

31+

}));

32+33+

vi.mock("openclaw/plugin-sdk/target-resolver-runtime", async (orig) => {

34+

// Preserve any sibling exports so importers that touch unrelated helpers

35+

// do not break; only override the function the channel actually calls.

36+

const original = (await orig()) as Record<string, unknown>;

37+

return {

38+

...original,

39+

resolveTargetsWithOptionalToken: resolveTargetsWithOptionalTokenMock,

40+

};

41+

});

42+43+

vi.mock("openclaw/plugin-sdk/extension-shared", async (orig) => {

44+

const original = (await orig()) as Record<string, unknown>;

45+

return {

46+

...original,

47+

buildPassiveProbedChannelStatusSummary: buildPassiveProbedChannelStatusSummaryMock,

48+

};

49+

});

50+51+

// --- Test setup -----------------------------------------------------------------

52+53+

beforeEach(() => {

54+

collectAuditFindingsMock.mockReset();

55+

fetchSlackScopesMock.mockReset();

56+

resolveTargetsWithOptionalTokenMock.mockReset();

57+

buildPassiveProbedChannelStatusSummaryMock.mockReset();

58+

setSlackRuntime({ channel: { slack: {} } } as never);

59+

});

60+61+

function makeMinimalSlackConfig(

62+

opts: { botToken?: string; userToken?: string } = {},

63+

): OpenClawConfig {

64+

const slack: Record<string, unknown> = {};

65+

if (opts.botToken !== undefined) {

66+

slack.botToken = opts.botToken;

67+

}

68+

if (opts.userToken !== undefined) {

69+

slack.userToken = opts.userToken;

70+

}

71+

return { channels: { slack } } as OpenClawConfig;

72+

}

73+74+

// --- Status: buildChannelSummary -------------------------------------------------

75+76+

describe("slackPlugin.status.buildChannelSummary lazy SDK forwarding", () => {

77+

it("calls the lazy extension-shared SDK helper with the snapshot and token sources, and returns its output unchanged", async () => {

78+

const buildChannelSummary = slackPlugin.status?.buildChannelSummary;

79+

if (!buildChannelSummary) {

80+

throw new Error("slackPlugin.status.buildChannelSummary should be exposed");

81+

}

82+83+

const sentinelSummary = { sentinel: "passive-summary" };

84+

buildPassiveProbedChannelStatusSummaryMock.mockReturnValue(sentinelSummary);

85+86+

const snapshot = {

87+

accountId: "default",

88+

configured: true,

89+

enabled: true,

90+

botTokenSource: "config" as const,

91+

appTokenSource: "config" as const,

92+

extra: { custom: 1 },

93+

};

94+95+

const result = await buildChannelSummary({

96+

account: { accountId: "default" } as never,

97+

snapshot,

98+

cfg: makeMinimalSlackConfig({ botToken: "xoxb-test" }),

99+

runtime: undefined,

100+

} as never);

101+102+

expect(buildPassiveProbedChannelStatusSummaryMock).toHaveBeenCalledTimes(1);

103+

const [forwardedSnapshot, forwardedExtras] =

104+

buildPassiveProbedChannelStatusSummaryMock.mock.calls[0] ?? [];

105+

// Snapshot must be forwarded by reference / structurally intact.

106+

expect(forwardedSnapshot).toBe(snapshot);

107+

// The channel must forward the (possibly fallback'd) token sources.

108+

expect(forwardedExtras).toEqual({ botTokenSource: "config", appTokenSource: "config" });

109+

// The SDK return value must be propagated through unchanged.

110+

expect(result).toBe(sentinelSummary);

111+

});

112+113+

it("falls back to 'none' for missing token sources before forwarding to the SDK helper", async () => {

114+

const buildChannelSummary = slackPlugin.status?.buildChannelSummary;

115+

if (!buildChannelSummary) {

116+

throw new Error("slackPlugin.status.buildChannelSummary should be exposed");

117+

}

118+119+

buildPassiveProbedChannelStatusSummaryMock.mockReturnValue({ sentinel: true });

120+121+

await buildChannelSummary({

122+

account: { accountId: "default" } as never,

123+

snapshot: { accountId: "default", configured: false, enabled: true } as never,

124+

cfg: makeMinimalSlackConfig(),

125+

runtime: undefined,

126+

} as never);

127+128+

const [, forwardedExtras] = buildPassiveProbedChannelStatusSummaryMock.mock.calls[0] ?? [];

129+

expect(forwardedExtras).toEqual({ botTokenSource: "none", appTokenSource: "none" });

130+

});

131+

});

132+133+

// --- Status: buildCapabilitiesDiagnostics ---------------------------------------

134+135+

describe("slackPlugin.status.buildCapabilitiesDiagnostics lazy scopes loader", () => {

136+

it("invokes fetchSlackScopes once when only a bot token is present", async () => {

137+

const buildDiagnostics = slackPlugin.status?.buildCapabilitiesDiagnostics;

138+

if (!buildDiagnostics) {

139+

throw new Error("slackPlugin.status.buildCapabilitiesDiagnostics should be exposed");

140+

}

141+142+

fetchSlackScopesMock.mockResolvedValue({ ok: true, scopes: ["chat:write"] });

143+144+

const cfg = makeMinimalSlackConfig({ botToken: "xoxb-bot" });

145+

const account = slackPlugin.config.resolveAccount(cfg, "default");

146+

const result = await buildDiagnostics({ account, timeoutMs: 1234, cfg } as never);

147+148+

expect(fetchSlackScopesMock).toHaveBeenCalledTimes(1);

149+

expect(fetchSlackScopesMock).toHaveBeenCalledWith("xoxb-bot", 1234);

150+

expect(result?.details).toMatchObject({

151+

botScopes: { ok: true, scopes: ["chat:write"] },

152+

});

153+

expect(result?.lines?.length ?? 0).toBeGreaterThan(0);

154+

});

155+156+

it("invokes fetchSlackScopes twice (bot and user) when both tokens are present", async () => {

157+

const buildDiagnostics = slackPlugin.status?.buildCapabilitiesDiagnostics;

158+

if (!buildDiagnostics) {

159+

throw new Error("slackPlugin.status.buildCapabilitiesDiagnostics should be exposed");

160+

}

161+162+

fetchSlackScopesMock

163+

.mockResolvedValueOnce({ ok: true, scopes: ["chat:write"] })

164+

.mockResolvedValueOnce({ ok: true, scopes: ["users:read"] });

165+166+

const cfg = makeMinimalSlackConfig({ botToken: "xoxb-bot", userToken: "xoxp-user" });

167+

const account = slackPlugin.config.resolveAccount(cfg, "default");

168+

const result = await buildDiagnostics({ account, timeoutMs: 5000, cfg } as never);

169+170+

expect(fetchSlackScopesMock).toHaveBeenCalledTimes(2);

171+

expect(fetchSlackScopesMock.mock.calls[0]).toEqual(["xoxb-bot", 5000]);

172+

expect(fetchSlackScopesMock.mock.calls[1]).toEqual(["xoxp-user", 5000]);

173+

expect(result?.details).toMatchObject({

174+

botScopes: { ok: true, scopes: ["chat:write"] },

175+

userScopes: { ok: true, scopes: ["users:read"] },

176+

});

177+

});

178+179+

it("does not invoke fetchSlackScopes when no bot token is present and reports a missing-token diagnostic", async () => {

180+

const buildDiagnostics = slackPlugin.status?.buildCapabilitiesDiagnostics;

181+

if (!buildDiagnostics) {

182+

throw new Error("slackPlugin.status.buildCapabilitiesDiagnostics should be exposed");

183+

}

184+185+

const cfg = makeMinimalSlackConfig();

186+

const account = slackPlugin.config.resolveAccount(cfg, "default");

187+

const result = await buildDiagnostics({ account, timeoutMs: 1000, cfg } as never);

188+189+

expect(fetchSlackScopesMock).not.toHaveBeenCalled();

190+

expect(result?.details).toMatchObject({

191+

botScopes: { ok: false, error: "Slack bot token missing." },

192+

});

193+

});

194+

});

195+196+

// --- Security: collectAuditFindings ---------------------------------------------

197+198+

describe("slackPlugin.security.collectAuditFindings lazy module forwarding", () => {

199+

it("delegates to the lazy security-audit module with the original params and returns its output", async () => {

200+

const collectAuditFindings = slackPlugin.security?.collectAuditFindings;

201+

if (!collectAuditFindings) {

202+

throw new Error("slackPlugin.security.collectAuditFindings should be exposed");

203+

}

204+205+

const sentinel = [

206+

{

207+

checkId: "test-check",

208+

severity: "info" as const,

209+

title: "t",

210+

detail: "d",

211+

},

212+

];

213+

collectAuditFindingsMock.mockResolvedValue(sentinel);

214+215+

const cfg = makeMinimalSlackConfig({ botToken: "xoxb-bot" });

216+

const account = slackPlugin.config.resolveAccount(cfg, "default");

217+

const result = await collectAuditFindings({ cfg, accountId: "default", account } as never);

218+219+

expect(collectAuditFindingsMock).toHaveBeenCalledTimes(1);

220+

expect(collectAuditFindingsMock.mock.calls[0]?.[0]).toEqual({

221+

cfg,

222+

accountId: "default",

223+

account,

224+

});

225+

expect(result).toBe(sentinel);

226+

});

227+228+

it("propagates an empty findings array unchanged", async () => {

229+

const collectAuditFindings = slackPlugin.security?.collectAuditFindings;

230+

if (!collectAuditFindings) {

231+

throw new Error("slackPlugin.security.collectAuditFindings should be exposed");

232+

}

233+234+

collectAuditFindingsMock.mockResolvedValue([]);

235+236+

const cfg = makeMinimalSlackConfig();

237+

const account = slackPlugin.config.resolveAccount(cfg, "default");

238+

const result = await collectAuditFindings({ cfg, account } as never);

239+240+

expect(result).toEqual([]);

241+

});

242+

});

243+244+

// --- Resolver: resolveTargets ---------------------------------------------------

245+246+

describe("slackPlugin.resolver.resolveTargets lazy SDK forwarding", () => {

247+

it("forwards user inputs and the configured token to the lazy SDK helper and returns its output", async () => {

248+

const resolveTargets = slackPlugin.resolver?.resolveTargets;

249+

if (!resolveTargets) {

250+

throw new Error("slackPlugin.resolver.resolveTargets should be exposed");

251+

}

252+253+

const sentinelOutput = [{ input: "U123", resolved: true, id: "U123", note: undefined }];

254+

resolveTargetsWithOptionalTokenMock.mockResolvedValue(sentinelOutput);

255+256+

const cfg = makeMinimalSlackConfig({ botToken: "xoxb-bot" });

257+

const result = await resolveTargets({

258+

cfg,

259+

accountId: "default",

260+

inputs: ["U123"],

261+

kind: "user",

262+

} as never);

263+264+

expect(resolveTargetsWithOptionalTokenMock).toHaveBeenCalledTimes(1);

265+

const [params] = resolveTargetsWithOptionalTokenMock.mock.calls[0] ?? [];

266+

expect(params).toMatchObject({

267+

token: "xoxb-bot",

268+

inputs: ["U123"],

269+

missingTokenNote: "missing Slack token",

270+

});

271+

expect(typeof params.resolveWithToken).toBe("function");

272+

expect(typeof params.mapResolved).toBe("function");

273+

expect(result).toBe(sentinelOutput);

274+

});

275+276+

it("prefers the user token over the bot token when both are configured", async () => {

277+

const resolveTargets = slackPlugin.resolver?.resolveTargets;

278+

if (!resolveTargets) {

279+

throw new Error("slackPlugin.resolver.resolveTargets should be exposed");

280+

}

281+282+

resolveTargetsWithOptionalTokenMock.mockResolvedValue([]);

283+284+

await resolveTargets({

285+

cfg: makeMinimalSlackConfig({ botToken: "xoxb-bot", userToken: "xoxp-user" }),

286+

accountId: "default",

287+

inputs: ["U1"],

288+

kind: "user",

289+

} as never);

290+291+

const [params] = resolveTargetsWithOptionalTokenMock.mock.calls[0] ?? [];

292+

expect(params).toMatchObject({ token: "xoxp-user" });

293+

});

294+295+

it("uses the same lazy SDK helper for kind='group'", async () => {

296+

const resolveTargets = slackPlugin.resolver?.resolveTargets;

297+

if (!resolveTargets) {

298+

throw new Error("slackPlugin.resolver.resolveTargets should be exposed");

299+

}

300+301+

resolveTargetsWithOptionalTokenMock.mockResolvedValue([]);

302+303+

await resolveTargets({

304+

cfg: makeMinimalSlackConfig({ botToken: "xoxb-bot" }),

305+

accountId: "default",

306+

inputs: ["C1"],

307+

kind: "group",

308+

} as never);

309+310+

expect(resolveTargetsWithOptionalTokenMock).toHaveBeenCalledTimes(1);

311+

const [params] = resolveTargetsWithOptionalTokenMock.mock.calls[0] ?? [];

312+

expect(params).toMatchObject({ token: "xoxb-bot", inputs: ["C1"] });

313+

});

314+

});

315+316+

// Setup-wizard proxy delegation is unit-tested directly in

317+

// setup-core.lazy-proxy.test.ts so it can be type-safe against the wider

318+

// ChannelSetupWizard contract returned by createSlackSetupWizardProxy.