diff --git a/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_settings/index.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_settings/index.test.tsx index 7eac3dcfd1d..ac2ffd6533e 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_settings/index.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_settings/index.test.tsx @@ -78,6 +78,19 @@ describe("CacheSettings", () => { expect(screen.getByText("Embedding Model")).toBeInTheDocument(); }); + it("should reveal the semantic fields when redis_semantic_cache_embedding_model is present", async () => { + // The third signal the component detects on. A config saved with only an + // embedding model set — no similarity_threshold, and redis_type left as a + // deployment topology rather than "semantic" — must still come back with the + // semantic section open, or the user silently loses the model they configured. + getCacheSettingsCall.mockResolvedValue({ + current_values: { redis_semantic_cache_embedding_model: "text-embedding-3-small" }, + }); + renderSettings(); + expect(await screen.findByText("Similarity Threshold")).toBeInTheDocument(); + expect(screen.getByText("Embedding Model")).toBeInTheDocument(); + }); + it("should NOT reveal the semantic fields when similarity_threshold is null", async () => { getCacheSettingsCall.mockResolvedValue({ current_values: { similarity_threshold: null } }); renderSettings();