fix(updates): sync entry-point states after component updates

This commit is contained in:
zipg authored and GitHub committed 2026-09-20 11:03:31 +08:00
1 parent db5e6f106b
commit 6babd1bf9b
7 files changed
+86 -7

No files matched your search

@@ -87,14 +87,17 @@ describe("useComponentUpdates", () => {
expect(updates.totalUpdateCount.value).toBe(4);
});
it("clears the driver count after a successful update and refresh", async () => {
it("clears driver and MCP update state after a successful update and refresh", async () => {
mocks.listInstalledAgents.mockResolvedValueOnce([{ db_type: "mysql", update_available: true }]).mockResolvedValueOnce([{ db_type: "mysql", update_available: false }]);
mocks.checkMcpServerStatus.mockResolvedValueOnce(mcpStatus).mockResolvedValueOnce({ ...mcpStatus, latest_version: "1.0.0", update_available: false });
const updates = useComponentUpdates({ isDesktop: true });
await updates.installCategories(["drivers"]);
await updates.installCategories(["drivers", "mcp"]);
expect(mocks.upgradeAllAgents).toHaveBeenCalledOnce();
expect(mocks.installMcpServer).toHaveBeenCalledOnce();
expect(updates.driverUpdateCount.value).toBe(0);
expect(updates.mcpUpdateAvailable.value).toBe(false);
});
it("installs every enabled component category after an app update", async () => {