I am trying to simulate an onChange event on file input to be able to test my upload
function. I know how to file onChange however I do not know what the parameter for onChange should be.
I know it's probably an event however I don't know how to create a file input event.
My react dom element:
<input className='attachmentInput' style={{ display: 'none' }} ref={(input) => this.attachmentInput = input} type='file' onChange={upload()}/>
My test code:
let file = new File(['some content'], 'filename.txt'
this.subject.find('.attachmentInput').props().onChange(?)