b.fire("click", ...) throws error, but b.clickLink(...) works #396

Closed
jamieorc opened this Issue Aug 15, 2012 · 1 comment

Projects

None yet

1 participant

@jamieorc

I've been trying to use fire(), but keep getting:

[TypeError: Cannot read property 'window' of undefined]

clickLink() works, but fire() works. I've tried both zombie 1.3.1 and 1.4.0 (from source):

// does not work:
b.fire("click", ".copter-button")

//does work:
b.clickLink(".copter-button")

I need to use fire() for some other events, but encounter the same problem. Am I using it incorrectly?

@jamieorc

Just after submitting this and looking at the source, I realized that fire() doesn't take a selector, but the actual target. So, this works fine:

b.fire("click", b.query(".copter-button"))

Wondering why not just take a selector as well.

@jamieorc jamieorc closed this Aug 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment