import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { RichText } from "@/components/ui/RichText";

describe("RichText", () => {
  it("renders evaluator markdown as readable structure instead of raw markers", () => {
    const { container } = render(<RichText value={"## 整体结论\n\n**部分通过**\n\n- 目标一\n- 目标二"} />);
    expect(screen.getByRole("heading", { name: "整体结论" })).toBeInTheDocument();
    expect(screen.getByText("部分通过").tagName).toBe("STRONG");
    expect(screen.getAllByRole("listitem")).toHaveLength(2);
    expect(container.textContent).not.toContain("##");
    expect(container.textContent).not.toContain("**");
  });
});
