Fix WebUI startup blocking on slow gateway routes
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
deleteSession,
|
||||
fetchFilePreview,
|
||||
fetchCliApps,
|
||||
fetchInstalledCliApps,
|
||||
fetchMcpPresets,
|
||||
fetchProviderModels,
|
||||
fetchSessionAutomations,
|
||||
@@ -375,6 +376,25 @@ describe("webui API helpers", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("reads installed CLI Apps without fetching the full catalog", async () => {
|
||||
vi.mocked(fetch).mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
apps: [],
|
||||
installed_count: 0,
|
||||
catalog_updated_at: null,
|
||||
}),
|
||||
} as Response);
|
||||
|
||||
await expect(fetchInstalledCliApps("tok")).resolves.toMatchObject({ apps: [] });
|
||||
expect(fetch).toHaveBeenCalledWith(
|
||||
"/api/settings/cli-apps?installed_only=1",
|
||||
expect.objectContaining({
|
||||
headers: { Authorization: "Bearer tok" },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("reads MCP presets and serializes actions", async () => {
|
||||
vi.mocked(fetch).mockResolvedValueOnce({
|
||||
ok: true,
|
||||
|
||||
Reference in New Issue
Block a user