diff --git a/packages/mui-material/src/Autocomplete/Autocomplete.js b/packages/mui-material/src/Autocomplete/Autocomplete.js index 5fcfc3d7abcad5..2aea5bf347fb6b 100644 --- a/packages/mui-material/src/Autocomplete/Autocomplete.js +++ b/packages/mui-material/src/Autocomplete/Autocomplete.js @@ -630,7 +630,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(inProps, ref) { ); let autocompletePopper = null; - if (!loading && groupedOptions.length > 0) { + if (groupedOptions.length > 0) { autocompletePopper = renderAutocompletePopperChildren( ', () => { fireEvent.keyDown(screen.getByRole('combobox'), { key: 'ArrowDown' }); expect(document.querySelector(`.${classes.paper}`).textContent).to.equal('Loading…'); }); + + it('should show supplied options to the "options" prop even when loading', () => { + render( + } + />, + ); + + fireEvent.keyDown(screen.getByRole('combobox'), { key: 'ArrowDown' }); + expect(document.querySelector(`.${classes.paper}`).textContent).not.to.equal('Loading…'); + + const listbox = screen.getByRole('listbox'); + const htmlOptions = listbox.querySelectorAll('li'); + expect(htmlOptions[0].innerHTML).to.equal('one'); + }); }); describe('prop: autoHighlight', () => {