Skip to content

Commit

Permalink
chore(select-input): add test for when autoFocussed is true (#993)
Browse files Browse the repository at this point in the history
* chore(select-input): add test for when autoFocussed is true
  • Loading branch information
montezume authored Aug 5, 2019
1 parent 8957638 commit 17d73b7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/inputs/select-input/select-input.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,25 @@ describe('in single mode', () => {
});
});
describe('interacting', () => {
describe('when isAutofocussed is `true`', () => {
it('should open the list and all options should be visible', () => {
const { getByLabelText, getByText } = renderInput({
isAutofocussed: true,
});

const input = getByLabelText('Fruit');

fireEvent.blur(input);

fireEvent.keyDown(input, {
key: 'ArrowDown',
});

expect(getByText('Mango')).toBeInTheDocument();
expect(getByText('Lichi')).toBeInTheDocument();
expect(getByText('Raspberry')).toBeInTheDocument();
});
});
it('should open the list and all options should be visible', () => {
const { getByLabelText, getByText } = renderInput();
const input = getByLabelText('Fruit');
Expand Down

0 comments on commit 17d73b7

Please sign in to comment.