import {useEffect} from 'react'; import {fireEvent, render, screen, waitFor} from 'sentry-test/reactTestingLibrary'; import AutoComplete from 'sentry/components/autoComplete'; const items = [ { name: 'Apple', }, { name: 'Pineapple', }, { name: 'Orange', }, ]; /** * For every render, we push all injected params into `autoCompleteState`, we probably want to * assert against those instead of the wrapper's state since component state will be different if we have * "controlled" props where does not handle state */ describe('AutoComplete', function () { let input; let autoCompleteState = []; const mocks = { onSelect: jest.fn(), onClose: jest.fn(), onOpen: jest.fn(), }; afterEach(() => { jest.resetAllMocks(); autoCompleteState = []; }); const List = ({registerItemCount, itemCount, ...props}) => { useEffect(() => void registerItemCount(itemCount), [itemCount, registerItemCount]); return