(mode: any)
| 4 | import { fireEvent, render } from '@testing-library/react'; |
| 5 | |
| 6 | export default function keyDownTest(mode: any) { |
| 7 | it('triggers keyDown', () => { |
| 8 | const onInputKeyDown = jest.fn(); |
| 9 | const { container } = render( |
| 10 | <Select mode={mode} onInputKeyDown={onInputKeyDown}> |
| 11 | <Option value="1">1</Option> |
| 12 | <Option value="2">2</Option> |
| 13 | </Select>, |
| 14 | ); |
| 15 | |
| 16 | fireEvent.keyDown(container.querySelector('input')); |
| 17 | expect(onInputKeyDown).toHaveBeenCalled(); |
| 18 | }); |
| 19 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…