/**
 * Tests for SkeletonStat component.
 */

import { render } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { SkeletonStat } from "../SkeletonStat";

describe("SkeletonStat", () => {
  it("renders label by default", () => {
    const { container } = render(<SkeletonStat />);
    const elements = container.querySelectorAll('[role="presentation"] > div');
    expect(elements).toHaveLength(2);
  });

  it("hides label when showLabel is false", () => {
    const { container } = render(<SkeletonStat showLabel={false} />);
    const elements = container.querySelectorAll('[role="presentation"] > div');
    expect(elements).toHaveLength(1);
  });

  it("marks elements as aria-hidden", () => {
    const { container } = render(<SkeletonStat />);
    const hidden = container.querySelectorAll('[aria-hidden="true"]');
    expect(hidden.length).toBeGreaterThan(0);
  });

  it("has proper accessibility attributes", () => {
    const { container } = render(<SkeletonStat />);
    const stat = container.querySelector('[role="presentation"]');
    expect(stat).toBeInTheDocument();
  });
});
