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

describe('TurnsStatInfo', () => {
  it('renders the four stat labels with Persian-digit values', () => {
    render(<TurnsStatInfo stats={{ total: 236, completed: 200, waiting: 12, cancelled: 5 }} />);
    expect(screen.getByText('کل نوبت های امروز')).toBeInTheDocument();
    expect(screen.getByText('نوبت های انجام شده')).toBeInTheDocument();
    expect(screen.getByText('بیماران در انتظار')).toBeInTheDocument();
    expect(screen.getByText('نوبت های لغو شده')).toBeInTheDocument();
    expect(screen.getByText('۲۳۶')).toBeInTheDocument();
    expect(screen.getByText('۲۰۰')).toBeInTheDocument();
  });

  it('renders zeros when there is no data (empty state)', () => {
    render(<TurnsStatInfo stats={{ total: 0, completed: 0, waiting: 0, cancelled: 0 }} />);
    // چهار مقدار صفر فارسی
    expect(screen.getAllByText('۰')).toHaveLength(4);
  });
});
