Skip to content

Commit

Permalink
Remove overly specific unit test that does not seem necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Jun 29, 2024
1 parent c522fe4 commit c056aa8
Showing 1 changed file with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,36 +145,6 @@ describe('AutoCompleteField', () => {
expect(screen.getByText('No options available')).toBeInTheDocument();
});

it('calls setAFieldValue, when an option is selected', async () => {
mockUseAggregated.mockReturnValue({
data: {
data: [
{ testField: 'Option 1', count: 10 },
{ testField: 'Option 2', count: 20 },
],
},
isLoading: false,
error: null,
mutate: vi.fn(),
});
render(
<AutoCompleteField
field={field}
setAFieldValue={setAFieldValue}
lapisUrl={lapisUrl}
lapisSearchParameters={lapisSearchParameters}
/>,
);

const input = screen.getByLabelText('Test Field');
fireEvent.focus(input);

const options = await screen.findAllByRole('option');
fireEvent.click(options[0]);

expect(setAFieldValue).toHaveBeenCalledWith('testField', 'Option 1');
});

it('clears input value on clear button click', async () => {
mockUseAggregated.mockReturnValue({
data: {
Expand Down

0 comments on commit c056aa8

Please sign in to comment.