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): reset mocks between LoggingSettings tests to prevent bleed-through

Ryan Crabbe7f48284decb1
diff --git a/ui/litellm-dashboard/src/components/Settings/AdminSettings/LoggingSettings/LoggingSettings.test.tsx b/ui/litellm-dashboard/src/components/Settings/AdminSettings/LoggingSettings/LoggingSettings.test.tsx
index 74413333ec4..1adf8039e6b 100644
--- a/ui/litellm-dashboard/src/components/Settings/AdminSettings/LoggingSettings/LoggingSettings.test.tsx
+++ b/ui/litellm-dashboard/src/components/Settings/AdminSettings/LoggingSettings/LoggingSettings.test.tsx
@@ -41,7 +41,7 @@ describe("LoggingSettings", () => {
const mockRefetch = vi.fn();
beforeEach(() => {
- vi.clearAllMocks();
+ vi.resetAllMocks();
mockUseStoreRequestInSpendLogs.mockReturnValue({
mutate: mockMutate,
isPending: false,
@@ -168,6 +168,9 @@ describe("LoggingSettings", () => {
it("should show a single error notification via onError callback", async () => {
const user = userEvent.setup();
const error = new Error("Backend error");
+ mockDeleteField.mockImplementation((_params, options) => {
+ options?.onSettled?.();
+ });
mockMutate.mockImplementation((_params, options) => {
options?.onError?.(error);
});