Skip to content

Commit

Permalink
chore(select-input): add test for when autoFocussed is true
Browse files Browse the repository at this point in the history
  • Loading branch information
montezume committed Aug 5, 2019
1 parent b65c16a commit ebd35ba
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 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,26 @@ 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',
keyCode: 40,
});

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 ebd35ba

Please sign in to comment.