test: dedupe ui bootstrap mock reads · openclaw/openclaw@47f31dd
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -316,14 +316,10 @@ describe("loadControlUiBootstrapConfig", () => {
|
316 | 316 | await loadControlUiBootstrapConfig(state); |
317 | 317 | |
318 | 318 | expect(fetchMock).toHaveBeenCalledTimes(2); |
319 | | -const [, firstInit] = fetchMock.mock.calls.at(0) ?? []; |
320 | | -const [, secondInit] = fetchMock.mock.calls.at(1) ?? []; |
321 | | -expect((firstInit?.headers as Record<string, string> | undefined)?.Authorization).toBe( |
322 | | -"Bearer stale-token", |
323 | | -); |
324 | | -expect((secondInit?.headers as Record<string, string> | undefined)?.Authorization).toBe( |
325 | | -"Bearer fresh-password", |
326 | | -); |
| 319 | +const firstFetchCall = requireFetchCall(fetchMock, 0); |
| 320 | +const secondFetchCall = requireFetchCall(fetchMock, 1); |
| 321 | +expect(firstFetchCall.headers.Authorization).toBe("Bearer stale-token"); |
| 322 | +expect(secondFetchCall.headers.Authorization).toBe("Bearer fresh-password"); |
327 | 323 | expect(state.assistantName).toBe("Ops"); |
328 | 324 | expect(state.serverVersion).toBe("2026.4.22"); |
329 | 325 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。