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

推荐订阅源

J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
C
Check Point Blog
D
Docker
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
量子位
有赞技术团队
有赞技术团队
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
M
MIT News - Artificial intelligence
B
Blog
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
月光博客
月光博客

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: require chat control buttons · openclaw/openclaw@83...
steipete · 2026-05-08 · via Recent Commits to openclaw:main

@@ -37,6 +37,15 @@ function createProps(overrides: Partial<ChatRunControlsProps> = {}): ChatRunCont

3737

};

3838

}

393940+

function getButton(container: Element, selector: string): HTMLButtonElement {

41+

const button = container.querySelector<HTMLButtonElement>(selector);

42+

expect(button).toBeInstanceOf(HTMLButtonElement);

43+

if (!(button instanceof HTMLButtonElement)) {

44+

throw new Error(`Expected button matching ${selector}`);

45+

}

46+

return button;

47+

}

48+4049

describe("chat run controls", () => {

4150

it("switches between idle and abort actions", () => {

4251

const container = document.createElement("div");

@@ -57,11 +66,11 @@ describe("chat run controls", () => {

5766

container,

5867

);

596860-

const queueButton = container.querySelector<HTMLButtonElement>('button[title="Queue"]');

61-

const stopButton = container.querySelector<HTMLButtonElement>('button[title="Stop"]');

62-

expect(queueButton?.disabled).toBe(true);

63-

expect(stopButton?.title).toBe("Stop");

64-

stopButton?.click();

69+

const queueButton = getButton(container, 'button[title="Queue"]');

70+

const stopButton = getButton(container, 'button[title="Stop"]');

71+

expect(queueButton.disabled).toBe(true);

72+

expect(stopButton.title).toBe("Stop");

73+

stopButton.click();

6574

expect(onAbort).toHaveBeenCalledTimes(1);

6675

expect(container.textContent).not.toContain("New session");

6776

@@ -81,16 +90,14 @@ describe("chat run controls", () => {

8190

container,

8291

);

839284-

const newSessionButton = container.querySelector<HTMLButtonElement>(

85-

'button[title="New session"]',

86-

);

87-

expect(newSessionButton?.title).toBe("New session");

88-

newSessionButton?.click();

93+

const newSessionButton = getButton(container, 'button[title="New session"]');

94+

expect(newSessionButton.title).toBe("New session");

95+

newSessionButton.click();

8996

expect(onNewSession).toHaveBeenCalledTimes(1);

909791-

const sendButton = container.querySelector<HTMLButtonElement>('button[title="Send"]');

92-

expect(sendButton?.title).toBe("Send");

93-

sendButton?.click();

98+

const sendButton = getButton(container, 'button[title="Send"]');

99+

expect(sendButton.title).toBe("Send");

100+

sendButton.click();

94101

expect(onStoreDraft).toHaveBeenCalledWith(" run this ");

95102

expect(onSend).toHaveBeenCalledTimes(1);

96103

expect(container.textContent).not.toContain("Stop");

@@ -112,9 +119,9 @@ describe("chat run controls", () => {

112119

container,

113120

);

114121115-

const queueButton = container.querySelector<HTMLButtonElement>('button[title="Queue"]');

116-

expect(queueButton?.disabled).toBe(false);

117-

queueButton?.click();

122+

const queueButton = getButton(container, 'button[title="Queue"]');

123+

expect(queueButton.disabled).toBe(false);

124+

queueButton.click();

118125

expect(onStoreDraft).toHaveBeenCalledWith(" follow up ");

119126

expect(onSend).toHaveBeenCalledTimes(1);

120127

});

@@ -133,9 +140,9 @@ describe("chat run controls", () => {

133140

container,

134141

);

135142136-

const stopButton = container.querySelector<HTMLButtonElement>('button[title="Stop"]');

137-

expect(stopButton?.disabled).toBe(false);

138-

stopButton?.click();

143+

const stopButton = getButton(container, 'button[title="Stop"]');

144+

expect(stopButton.disabled).toBe(false);

145+

stopButton.click();

139146

expect(onAbort).toHaveBeenCalledTimes(1);

140147

});

141148

});

@@ -290,7 +297,7 @@ describe("context notice", () => {

290297

const onCompact = vi.fn();

291298

render(renderContextNotice(session, 200_000, { onCompact }), container);

292299

expect(container.textContent).toContain("Compact");

293-

container.querySelector<HTMLButtonElement>(".context-notice__action")?.click();

300+

getButton(container, ".context-notice__action").click();

294301

expect(onCompact).toHaveBeenCalledTimes(1);

295302296303

expect(

@@ -348,8 +355,11 @@ describe("side result render", () => {

348355

expect(container.querySelectorAll(".chat-side-result")).toHaveLength(1);

349356350357

const button = container.querySelector<HTMLButtonElement>(".chat-side-result__dismiss");

351-

expect(button).not.toBeNull();

352-

button?.click();

358+

expect(button).toBeInstanceOf(HTMLButtonElement);

359+

if (!(button instanceof HTMLButtonElement)) {

360+

throw new Error("Expected side result dismiss button");

361+

}

362+

button.click();

353363

expect(onDismissSideResult).toHaveBeenCalledTimes(1);

354364355365

render(