import { render, screen } from '@testing-library/react'
import { describe, expect, it } from 'vitest'

import { FilterCard } from './FilterCard'

vi.mock('antd', () => ({
  Card: ({
    children,
    className,
  }: {
    children?: React.ReactNode
    className?: string
  }) => (
    <div data-testid="card" data-class={className}>
      {children}
    </div>
  ),
}))

describe('FilterCard', () => {
  it('renders children content', () => {
    render(
      <FilterCard>
        <div>filter content</div>
      </FilterCard>,
    )

    expect(screen.getByText('filter content')).toBeInTheDocument()
  })

  it('applies custom className', () => {
    render(
      <FilterCard className="custom-filter-class">
        <div>content</div>
      </FilterCard>,
    )

    expect(screen.getByTestId('card')).toHaveAttribute('data-class', expect.stringContaining('custom-filter-class'))
  })
})
