import { Field } from '../field/Field';
import { mockMatchMedia, render, screen } from '../test-utils';
import Select from './Select';

mockMatchMedia();

describe('Select', () => {
  it('supports `Field` for labeling', () => {
    const options = [{ value: 'USD', label: 'USD' }];
    render(
      <Field label="Currency">
        <Select options={options} selected={options[0]} onChange={() => {}} />
      </Field>,
    );
    expect(screen.getByLabelText(/Currency/)).toHaveTextContent('USD');
  });
});
