I am using react-testing-library for my react app. In one test case, I need to fill some value in a textbox and focusout.
Here is the test script -
it('searchbox wrapper',async()=>{
let wrapper=getSearchBoxWrapperInstance('')
let inputBox=wrapper.findByTestId('inputText');
inputBox.value='12345';
fireEvent(inputBox,'focusOut');
})
I am getting the following error when I run the test case -
TypeError: element.dispatchEvent is not a function
79 | let inputBox=wrapper.findByTestId('inputText');
80 | inputBox.value='12345';
> 81 | fireEvent(inputBox,'focusOut');
| ^
82 | //fireEvent('Blur',
83 |
84 | //await (() => wrapper.getByText('')))
at fireEvent (node_modules/dom-testing-library/dist/events.js:533:18)
Please let me know if I can provide further information