click() vs dispatchEvent() on disabled elements
const { JSDOM } = require("jsdom");
const { window } = new JSDOM(`
<!DOCTYPE html>
<html>
<body><button disabled></button></body>
</html>
`);
const button = window.document.querySelector('button');
button.addEventListener('click', () => console.log('click'));
button.click();
button.dispatchEvent(new window.MouseEvent('click'))
no comments