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]

feat: extract OnboardingErrorView component with tests

yuneng-jianga347cf0a332c
diff --git a/ui/litellm-dashboard/src/app/onboarding/OnboardingErrorView.test.tsx b/ui/litellm-dashboard/src/app/onboarding/OnboardingErrorView.test.tsx
new file mode 100644
index 00000000000..f2252a047a6
--- /dev/null
+++ b/ui/litellm-dashboard/src/app/onboarding/OnboardingErrorView.test.tsx
@@ -0,0 +1,25 @@
+import React from "react";
+import { render, screen } from "@testing-library/react";
+import { describe, it, expect } from "vitest";
+import { OnboardingErrorView } from "./OnboardingErrorView";
+
+describe("OnboardingErrorView", () => {
+ it("shows the failed to load invitation message", () => {
+ render(<OnboardingErrorView />);
+ expect(screen.getByText("Failed to load invitation")).toBeInTheDocument();
+ });
+
+ it("shows the expiry description", () => {
+ render(<OnboardingErrorView />);
+ expect(
+ screen.getByText("The invitation link may be invalid or expired.")
+ ).toBeInTheDocument();
+ });
+
+ it("renders a Back to Login link pointing to /ui/login", () => {
+ render(<OnboardingErrorView />);
+ // antd Button with href renders as an <a> element
+ const link = screen.getByRole("link", { name: "Back to Login" });
+ expect(link).toHaveAttribute("href", "/ui/login");
+ });
+});
diff --git a/ui/litellm-dashboard/src/app/onboarding/OnboardingErrorView.tsx b/ui/litellm-dashboard/src/app/onboarding/OnboardingErrorView.tsx
new file mode 100644
index 00000000000..ca0f57c56ce
--- /dev/null
+++ b/ui/litellm-dashboard/src/app/onboarding/OnboardingErrorView.tsx
@@ -0,0 +1,18 @@
+import React from "react";
+import { Alert, Button } from "antd";
+
+export function OnboardingErrorView() {
+ return (
+ <div className="mx-auto w-full max-w-md mt-10">
+ <Alert
+ type="error"
+ message="Failed to load invitation"
+ description="The invitation link may be invalid or expired."
+ showIcon
+ />
+ <div className="mt-4">
+ <Button href="/ui/login">Back to Login</Button>
+ </div>
+ </div>
+ );
+}