'm dealing with some some code relating to handling paste events, where the copied data comes from a variety of sources. In it, I'll capture the paste event, and do some processing on it.
I now want to write some tests for this code, and it'll be a lot easier if I can just capture the paste event that I console.log.
Is this possible?
ie. I can reproduce a 'good enough' event like:
const dataTransfer = new DataTransfer();
dataTransfer.items.add("...", "text/plain");
const pasteEvent = new ClipboardEvent("paste", {
clipboardData: dataTransfer
})
I'm hoping the dev tools can help do this for me.