Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(ui): cover the edit project modal's required-field validation (#37363)

yuneng-jiang56d926ac542d
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectModals/EditProjectModal.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectModals/EditProjectModal.integration.test.tsx
index 7227531c2b3..52277d62494 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectModals/EditProjectModal.integration.test.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectModals/EditProjectModal.integration.test.tsx
@@ -154,6 +154,17 @@ describe("EditProjectModal submit payload", () => {
expect(variables().params.metadata).toStrictEqual({ owner: "platform" });
});
+ it("blocks the save when the project name is cleared", async () => {
+ const user = setup();
+ renderModal();
+
+ await user.clear(screen.getByLabelText("Project Name"));
+ await save(user);
+
+ expect(await screen.findByText("Please enter a project name")).toBeInTheDocument();
+ expect(mutate).not.toHaveBeenCalled();
+ });
+
it("sends an edited project name", async () => {
const user = setup();
renderModal();