improve(updates): close update center after component updates

This commit is contained in:
zipg authored and GitHub committed 2026-09-20 00:50:25 +08:00
1 parent f9b984da68
commit fff07eff00
4 files changed
+52 -2

No files matched your search

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