diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js b/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js index ab064355f91040..d64dc05227daff 100644 --- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js +++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js @@ -68,6 +68,29 @@ describe('', () => { expect(handleChange.callCount).to.equal(1); expect(handleChange.args[0][1]).to.deep.equal([options[0]]); }); + + it('navigates between different tags', () => { + const handleChange = spy(); + const options = ['one', 'two']; + const { getByRole } = render( + } + multiple + />, + ); + const textbox = getByRole('textbox'); + fireEvent.keyDown(document.activeElement, { key: 'ArrowLeft' }); + expect(document.activeElement).to.have.text('two'); + fireEvent.keyDown(document.activeElement, { key: 'ArrowLeft' }); + expect(document.activeElement).to.have.text('one'); + fireEvent.keyDown(document.activeElement, { key: 'Backspace' }); + expect(handleChange.callCount).to.equal(1); + expect(handleChange.args[0][1]).to.deep.equal([options[1]]); + expect(document.activeElement).to.equal(textbox); + }); }); describe('WAI-ARIA conforming markup', () => {