import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { Spinner } from "./spinner";
describe("Spinner", () => {
it("renders with icon slot and default aria-hidden semantics", () => {
render();
const spinner = screen.getByTestId("spinner");
expect(spinner).toHaveAttribute("data-slot", "icon");
expect(spinner).toHaveAttribute("data-size", "lg");
expect(spinner).toHaveAttribute("data-tone", "primary");
expect(spinner).toHaveAttribute("aria-hidden", "true");
});
it("keeps an accessible label when one is provided", () => {
render();
expect(screen.getByLabelText("Loading releases")).not.toHaveAttribute("aria-hidden");
});
});