fix(web): close final workbench interaction gaps

This commit is contained in:
2026-07-22 01:24:51 +08:00
parent 26c3e6fd8a
commit b1ce837845
23 changed files with 808 additions and 175 deletions

View File

@@ -50,9 +50,18 @@ test('interrupted successful response body rejects with a stable invalid_respons
})
test('204 response returns undefined without reading a body', async () => {
globalThis.fetch = async () => new Response(null, { status: 204 })
let textCalls = 0
globalThis.fetch = async () => ({
ok: true,
status: 204,
text: async () => {
textCalls += 1
throw new Error('204 body must not be read')
},
})
assert.equal(await apiRequest('/no-content'), undefined)
assert.equal(textCalls, 0)
})
test('explicit void response returns undefined for a non-204 response', async () => {