import { render, screen } from "@testing-library/react";
import { GlitchSlideCarousel } from "./GlitchSlideCarousel";
import type { GlitchSlide } from "../types/lecture";

const candidates: GlitchSlide[] = [
  {
    id: "slide-a",
    score: 0.9,
    componentKey: "SquareYellow",
    authorName: "Ada",
    props: {
      header: "A",
      imageSrc: "/a.jpg",
      imageAlt: "A"
    }
  },
  {
    id: "slide-b",
    score: 0.7,
    componentKey: "SquareYellow",
    authorName: "Ben",
    props: {
      header: "B",
      imageSrc: "/b.jpg",
      imageAlt: "B"
    }
  }
];

describe("GlitchSlideCarousel", () => {
  it("shows the active candidate author in inspect mode", () => {
    render(
      <GlitchSlideCarousel
        candidates={candidates}
        displayMode="square"
        activeGlitchSlide={candidates[1]}
        isInspecting
        isDragging
        viewportMode="mobile-portrait"
      />
    );

    expect(screen.getByText("By Ben")).toBeInTheDocument();
  });
});
