> In  what  kind  of real user case would you need this? When you must
> act like you actually clicked a link (or whatever element that has a
> click event attached) when you didn't?

When  you  are  using  a  third-party  (or  inalterable for some other
reason)  event  handler that expects an Event to be passed and doesn't
create  its  own  mock  `e` internally when it's been fake-fired. IOW,
when  you want to fire an event handler that depends on an event (even
though the two could/should be separate).

You  can  fake  a  duck-typed Event, as Barry suggested, by adding the
minimal  props  to  a  simple Object, but this requires inspecting the
handler  code  in depth and could be really annoying to maintain. Pass
it a real Event and you shouldn't need to worry about faking anything.

-- S.

Reply via email to