Closed D-Ne0 closed 10 years ago
Hi
It's because the meteor stub defines events as a function, which then sets the events object inside the stub that the fire events relies on. I guess we could make fireEvent a little more intelligent in that it checks to see if the user specified the events object directly, vs using the method approach, and would then pull out the event accordingly. I'll keep this open so we can code that, but changing your code for now is going to be the quickest as we're working on porting the unit testing of RTD to velocity
closing here as won't fix in RTD
In my project I have defined template events in the following way:
When I call Template.xyz.fireEvent('click .some-class') in a spec it throws an error: "TypeError: 'undefined' is not a function (evaluating 'TemplateClass.prototype[templateName].eventMap[key]()')"
But If I define the events in the following way, the error is gone.
What could be the reason for this behavior?