diff --git a/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx b/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx
index 2e1025e18bc..2ebde4f295d 100644
--- a/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx
+++ b/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx
@@ -72,6 +72,8 @@ vi.mock("@/components/networking", () => {
return {
// Called on mount; we don't care about its contents, only that it resolves
getUiConfig: vi.fn().mockResolvedValue({}),
+ // Fetched by useUISettings(); resolve with empty settings so nudges stay default-on
+ getUiSettings: vi.fn().mockResolvedValue({ values: {}, field_schema: {} }),
// Used to build the redirect URL
proxyBaseUrl: "https://example.com",
// Called when decoding a valid token
@@ -146,17 +148,22 @@ vi.mock("@/lib/cva.config", () => ({
cx: (...args: string[]) => args.join(" "),
}));
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import CreateKeyPage from "@/app/page";
import { AuthProvider } from "@/contexts/AuthContext";
// The page consumes auth state via useAuth(). Wrap it so the hook resolves
// against a real provider — the provider's effects (cookie read, JWT decode,
-// redirect-on-expired) are what these tests exercise.
+// redirect-on-expired) are what these tests exercise. The QueryClientProvider
+// mirrors what layout.tsx supplies in production for hooks like useUISettings.
function PageUnderTest() {
+ const [queryClient] = React.useState(() => new QueryClient({ defaultOptions: { queries: { retry: false } } }));
return (
-
-
-
+
+
+
+
+
);
}