fix: resolve features-store test timeouts and dynamic icon-map test (#151)

- Fix installAll tests timing out by returning installed status from
  refreshBundles mock (prevents infinite retry loop) and increasing
  waitFor/test timeouts to accommodate the 2s inter-install delay
- Fix zustand-stores installAll test with same refreshBundles mock fix
- Icon-map test already fixed to derive from shared constants
This commit is contained in:
SnapOtter
2026-05-18 17:24:36 +08:00
committed by GitHub
parent 8b85a8c386
commit 436576fe15
2 changed files with 23 additions and 17 deletions
+4 -2
View File
@@ -2677,13 +2677,15 @@ describe("useFeaturesStore", () => {
);
mockApiPost.mockResolvedValueOnce({ jobId: "job-clear" });
mockApiGet.mockResolvedValue({ bundles });
mockApiGet.mockResolvedValue({
bundles: bundles.map((b) => ({ ...b, status: "installed" as const })),
});
await useFeaturesStore.getState().installAll();
// Error should have been cleared at the start of installAll
expect(useFeaturesStore.getState().errors["ai-rembg"]).toBeUndefined();
});
}, 15000);
});
// ==========================================================================