import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '@testing-library/react';
import { Select } from './select';
const doNothing = () => {
// do nothing
};
const selectOptions = [
{ id: 'option1', name: 'Option 1', value: 'option1' },
{ id: 'option2', name: 'Option 2', value: 'option2' },
{ id: 'option3', name: 'Option 3', value: 'option3' },
];
const selected = selectOptions[0];
describe('Select', () => {
it('should correctly set default option', () => {
render(
);
expect(rtlScreen.getByRole('combobox')).toHaveValue(selected.value);
});
it('renders the select options', () => {
render(
);
expect(rtlScreen.getAllByRole('option')).toHaveLength(selectOptions.length);
});
});