test: tighten tlon upload body assertions · openclaw/openclaw@d0a41b1
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -130,7 +130,6 @@ describe("uploadFile memex upload hardening", () => {
|
130 | 130 | init: expect.objectContaining({ |
131 | 131 | method: "PUT", |
132 | 132 | headers: { "Content-Type": "application/json" }, |
133 | | -body: expect.any(String), |
134 | 133 | }), |
135 | 134 | auditContext: "tlon-memex-upload-url", |
136 | 135 | capture: false, |
@@ -141,7 +140,6 @@ describe("uploadFile memex upload hardening", () => {
|
141 | 140 | url: "https://uploads.tlon.network/put", |
142 | 141 | init: expect.objectContaining({ |
143 | 142 | method: "PUT", |
144 | | -body: expect.any(Blob), |
145 | 143 | headers: expect.objectContaining({ |
146 | 144 | "Cache-Control": "public, max-age=3600", |
147 | 145 | "Content-Type": "image/png", |
@@ -161,6 +159,8 @@ describe("uploadFile memex upload hardening", () => {
|
161 | 159 | contentType: "image/png", |
162 | 160 | }); |
163 | 161 | expect(typeof firstBody.fileName).toBe("string"); |
| 162 | +const secondCall = mockGuardedFetch.mock.calls[1]?.[0]; |
| 163 | +expect(secondCall?.init?.body).toBeInstanceOf(Blob); |
164 | 164 | expect(mockRelease).toHaveBeenCalledTimes(2); |
165 | 165 | }); |
166 | 166 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。