Fix private AI custom endpoints (#1299)

This commit is contained in:
ZacharyZcR
2026-08-23 22:38:03 +08:00
committed by GitHub
parent fbf267fe5f
commit b5d13c3664
5 changed files with 50 additions and 10 deletions
@@ -82,4 +82,17 @@ describe("AiProviderSettings", () => {
screen.getByRole("combobox", { name: "ai.defaultModel" }),
).toBeTruthy();
});
it("shows the provider error when refreshing models fails", async () => {
api.getAiProviderModels.mockRejectedValue(
new Error("Add llm.internal to the AI endpoint allowlist"),
);
render(<AiProviderSettings providers={[provider]} onChanged={() => {}} />);
fireEvent.click(screen.getByRole("button", { name: "ai.editProvider" }));
expect(
await screen.findByText("Add llm.internal to the AI endpoint allowlist"),
).toBeTruthy();
});
});