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

推荐订阅源

Recent Announcements
Recent Announcements
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
博客园 - 司徒正美
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
小众软件
小众软件
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
A
About on SuperTechFans
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
B
Blog RSS Feed
G
Google Developers Blog
量子位
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)

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: dedupe slack interaction mock calls · openclaw/open...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -313,7 +313,7 @@ function mockCallArg(mock: unknown, index: number, label: string, argIndex = 0):

313313

if (!Array.isArray(calls)) {

314314

throw new Error(`Expected ${label} to be a mock`);

315315

}

316-

const call = calls[index];

316+

const call = calls.at(index);

317317

if (!call) {

318318

throw new Error(`Expected ${label} call ${index + 1}`);

319319

}

@@ -344,6 +344,14 @@ function slackInteractionPayload(callIndex = 0): Record<string, unknown> {

344344

return JSON.parse(eventText.replace("Slack interaction: ", "")) as Record<string, unknown>;

345345

}

346346347+

function enqueueSystemEventText(callIndex = 0): string {

348+

const eventText = mockCallArg(enqueueSystemEventMock, callIndex, "enqueueSystemEvent");

349+

if (typeof eventText !== "string") {

350+

throw new Error("Expected Slack interaction event text");

351+

}

352+

return eventText;

353+

}

354+347355

function chatUpdateCall(app: { client: { chat: { update: unknown } } }, callIndex = 0) {

348356

return requireRecord(

349357

mockCallArg(app.client.chat.update, callIndex, "chat.update"),

@@ -506,8 +514,11 @@ describe("registerSlackInteractionEvents", () => {

506514

});

507515508516

expect(ack).toHaveBeenCalled();

509-

const dispatchCalls = dispatchPluginInteractiveHandlerMock.mock.calls as unknown[][];

510-

const dispatchCall = dispatchCalls[0]?.[0] as

517+

const dispatchCall = mockCallArg(

518+

dispatchPluginInteractiveHandlerMock,

519+

0,

520+

"plugin interactive dispatcher",

521+

) as

511522

| {

512523

channel?: string;

513524

data?: string;

@@ -598,7 +609,11 @@ describe("registerSlackInteractionEvents", () => {

598609

},

599610

});

600611601-

const dispatchCall = dispatchPluginInteractiveHandlerMock.mock.calls[0]?.[0] as

612+

const dispatchCall = mockCallArg(

613+

dispatchPluginInteractiveHandlerMock,

614+

0,

615+

"plugin interactive dispatcher",

616+

) as

602617

| {

603618

invoke?: (params: {

604619

registration: { handler: (ctx: unknown) => unknown };

@@ -667,7 +682,11 @@ describe("registerSlackInteractionEvents", () => {

667682

},

668683

});

669684670-

const dispatchCall = dispatchPluginInteractiveHandlerMock.mock.calls[0]?.[0] as

685+

const dispatchCall = mockCallArg(

686+

dispatchPluginInteractiveHandlerMock,

687+

0,

688+

"plugin interactive dispatcher",

689+

) as

671690

| {

672691

invoke?: (params: {

673692

registration: { handler: (ctx: unknown) => unknown };

@@ -1390,7 +1409,7 @@ describe("registerSlackInteractionEvents", () => {

1390140913911410

expect(ack).toHaveBeenCalled();

13921411

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

1393-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

1412+

const eventText = enqueueSystemEventText();

13941413

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

13951414

actionType: string;

13961415

selectedValues?: string[];

@@ -1747,7 +1766,7 @@ describe("registerSlackInteractionEvents", () => {

17471766

threadTs: "222.111",

17481767

});

17491768

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

1750-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

1769+

const eventText = enqueueSystemEventText();

17511770

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

17521771

channelId?: string;

17531772

messageTs?: string;

@@ -1985,7 +2004,7 @@ describe("registerSlackInteractionEvents", () => {

1985200419862005

expect(ack).toHaveBeenCalled();

19872006

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

1988-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

2007+

const eventText = enqueueSystemEventText();

19892008

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

19902009

actionType: string;

19912010

selectedValues?: string[];

@@ -2046,7 +2065,7 @@ describe("registerSlackInteractionEvents", () => {

2046206520472066

expect(ack).toHaveBeenCalled();

20482067

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

2049-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

2068+

const eventText = enqueueSystemEventText();

20502069

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

20512070

actionType?: string;

20522071

workflowTriggerUrl?: string;

@@ -2126,7 +2145,7 @@ describe("registerSlackInteractionEvents", () => {

21262145

senderId: "U777",

21272146

});

21282147

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

2129-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

2148+

const eventText = enqueueSystemEventText();

21302149

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

21312150

interactionType: string;

21322151

actionId: string;

@@ -2361,7 +2380,7 @@ describe("registerSlackInteractionEvents", () => {

2361238023622381

expect(ack).toHaveBeenCalled();

23632382

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

2364-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

2383+

const eventText = enqueueSystemEventText();

23652384

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

23662385

inputs: Array<{

23672386

actionId: string;

@@ -2478,7 +2497,7 @@ describe("registerSlackInteractionEvents", () => {

24782497

});

2479249824802499

expect(ack).toHaveBeenCalled();

2481-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

2500+

const eventText = enqueueSystemEventText();

24822501

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

24832502

inputs: Array<{ actionId: string; richTextPreview?: string }>;

24842503

};

@@ -2534,10 +2553,11 @@ describe("registerSlackInteractionEvents", () => {

25342553

expect(ack).toHaveBeenCalled();

25352554

expect(resolveSessionKey).not.toHaveBeenCalled();

25362555

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

2537-

const [eventText, options] = enqueueSystemEventMock.mock.calls[0] as [

2538-

string,

2539-

{ sessionKey?: string },

2540-

];

2556+

const eventText = enqueueSystemEventText();

2557+

const options = requireRecord(

2558+

mockCallArg(enqueueSystemEventMock, 0, "enqueueSystemEvent", 1),

2559+

"enqueueSystemEvent options",

2560+

) as { sessionKey?: string };

25412561

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

25422562

interactionType: string;

25432563

actionId: string;

@@ -2596,7 +2616,7 @@ describe("registerSlackInteractionEvents", () => {

2596261625972617

expect(ack).toHaveBeenCalled();

25982618

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

2599-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

2619+

const eventText = enqueueSystemEventText();

26002620

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

26012621

interactionType: string;

26022622

isCleared?: boolean;

@@ -2651,7 +2671,7 @@ describe("registerSlackInteractionEvents", () => {

2651267126522672

expect(ack).toHaveBeenCalled();

26532673

expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);

2654-

const [eventText] = enqueueSystemEventMock.mock.calls[0] as [string];

2674+

const eventText = enqueueSystemEventText();

26552675

expect(eventText.length).toBeLessThanOrEqual(2400);

26562676

const payload = JSON.parse(eventText.replace("Slack interaction: ", "")) as {

26572677

payloadTruncated?: boolean;