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]

1.0 KB
Raw Blame
import React from "react";
import { render, screen } from "@testing-library/react";
import { describe, it, expect } from "vitest";
import { OnboardingErrorView } from "./OnboardingErrorView";

describe("OnboardingErrorView", () => {
  it("should show the failed to load invitation message", () => {
    render(<OnboardingErrorView />);
    expect(screen.getByText("Failed to load invitation")).toBeInTheDocument();
  });

  it("should expose the failure as an alert to assistive technology", () => {
    render(<OnboardingErrorView />);
    expect(screen.getByRole("alert")).toHaveTextContent("Failed to load invitation");
  });

  it("should show the expiry description", () => {
    render(<OnboardingErrorView />);
    expect(screen.getByText("The invitation link may be invalid or expired.")).toBeInTheDocument();
  });

  it("should render a Back to Login link pointing to /ui/login/", () => {
    render(<OnboardingErrorView />);
    const link = screen.getByRole("link", { name: "Back to Login" });
    expect(link).toHaveAttribute("href", "/ui/login/");
  });
});