test: tighten browser screenshot socket assertion · openclaw/openclaw@110743d
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/browser/src/browser
| Original file line number | Diff line number | Diff line change |
|---|
@@ -127,11 +127,12 @@ describe("CDP screenshot params", () => {
|
127 | 127 | timeoutMs: 12_345, |
128 | 128 | }); |
129 | 129 | |
130 | | -expect(withCdpSocket).toHaveBeenCalledWith( |
131 | | -"ws://localhost:9222/devtools/page/X", |
132 | | -expect.any(Function), |
133 | | -{ commandTimeoutMs: 12_345 }, |
134 | | -); |
| 130 | +const [wsUrl, sendCallback, options] = |
| 131 | +(withCdpSocket as unknown as { mock: { calls: Array<Array<unknown>> } }).mock.calls.at(-1) ?? |
| 132 | +[]; |
| 133 | +expect(wsUrl).toBe("ws://localhost:9222/devtools/page/X"); |
| 134 | +expect(typeof sendCallback).toBe("function"); |
| 135 | +expect(options).toEqual({ commandTimeoutMs: 12_345 }); |
135 | 136 | }); |
136 | 137 | |
137 | 138 | it("fullPage on emulated tab: clears, detects drift, re-applies saved emulation", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。