Use `addEventListener` instead of stubbing the function.