fix(onboard): cancel custom verification bodies · openclaw/openclaw@c79a5aa
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -108,6 +108,27 @@ describe("promptCustomApiConfig", () => {
|
108 | 108 | expect(prompter.confirm).not.toHaveBeenCalled(); |
109 | 109 | }); |
110 | 110 | |
| 111 | +it("cancels custom provider verification response bodies", async () => { |
| 112 | +const prompter = createTestPrompter({ |
| 113 | +text: ["http://localhost:11434/v1", "", "llama3", "custom", ""], |
| 114 | +select: ["plaintext", "openai"], |
| 115 | +}); |
| 116 | +const cancel = vi.fn(async () => undefined); |
| 117 | +vi.stubGlobal( |
| 118 | +"fetch", |
| 119 | +vi.fn(async () => ({ |
| 120 | +ok: true, |
| 121 | +status: 200, |
| 122 | +headers: new Headers({ "content-type": "application/json; charset=utf-8" }), |
| 123 | +body: { cancel }, |
| 124 | +})), |
| 125 | +); |
| 126 | + |
| 127 | +await runPromptCustomApi(prompter); |
| 128 | + |
| 129 | +expect(cancel).toHaveBeenCalledTimes(1); |
| 130 | +}); |
| 131 | + |
111 | 132 | it("handles explicit OpenAI Responses flow", async () => { |
112 | 133 | const prompter = createTestPrompter({ |
113 | 134 | text: ["https://proxy.example.com/v1", "test-key", "gpt-5.4", "custom", ""], |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。