I find it important to notice, that the input event has some complexity around the event.inputType property which can be challenging to mimic.
The inputType event property is used to determine the kind of change that was performed, since the input event is triggered after the change has taken place.
Notice, it is not allowed to set the inputType as an event detail on a system event, but this work-around seems to work in my own tests.
const inpType = "insertText";
const evt = new Event('input', { bubbles: true, cancelable: true })
evt.inputType = inpType;
inputField.dispatchEvent(evt);
Please read this documentation (and try the sample within) on Mozilla.org
Here are the behaviors triggering the various inputType enums: w3c.org