import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { Select } from '../select';
describe('Select', () => {
it('renders select element', () => {
render(
);
expect(screen.getByTestId('select')).toBeInTheDocument();
});
it('renders with placeholder', () => {
render(
);
expect(screen.getByText('Select option')).toBeInTheDocument();
});
it('renders all options', () => {
render(
);
expect(screen.getByText('Option A')).toBeInTheDocument();
expect(screen.getByText('Option B')).toBeInTheDocument();
expect(screen.getByText('Option C')).toBeInTheDocument();
});
it('applies custom className', () => {
render(
);
expect(screen.getByTestId('select')).toHaveClass('custom-select');
});
it('is disabled when disabled prop is true', () => {
render(
);
expect(screen.getByTestId('select')).toBeDisabled();
});
});