/**
 * ComingSoon Component Tests
 * Tests for the production placeholder component
 */

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

describe("ComingSoon", (): void => {
  it("should render with default props", (): void => {
    render(<ComingSoon feature="Test Feature" />);

    expect(screen.getByText("Coming Soon")).toBeInTheDocument();
    expect(screen.getByText("Test Feature")).toBeInTheDocument();
    expect(screen.getByText(/This feature is currently under development/i)).toBeInTheDocument();
  });

  it("should render custom description", (): void => {
    render(<ComingSoon feature="Custom Feature" description="Custom description text" />);

    expect(screen.getByText("Custom Feature")).toBeInTheDocument();
    expect(screen.getByText("Custom description text")).toBeInTheDocument();
  });

  it("should render children when provided", (): void => {
    render(
      <ComingSoon feature="Feature">
        <div data-testid="child-content">Child content</div>
      </ComingSoon>
    );

    expect(screen.getByTestId("child-content")).toBeInTheDocument();
    expect(screen.getByText("Child content")).toBeInTheDocument();
  });

  it("should apply custom className", (): void => {
    render(<ComingSoon feature="Test" className="custom-class" />);

    const container = screen.getByRole("main");
    expect(container).toHaveClass("custom-class");
  });

  it("should render construction icon by default", (): void => {
    render(<ComingSoon feature="Test" />);

    // The icon should be present (as an SVG)
    const svg = document.querySelector("svg");
    expect(svg).toBeInTheDocument();
  });
});
