Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests are needed. #33

Closed
RobertWHurst opened this issue Nov 25, 2012 · 6 comments
Closed

Tests are needed. #33

RobertWHurst opened this issue Nov 25, 2012 · 6 comments

Comments

@RobertWHurst
Copy link
Owner

I really need to add proper tests. This is difficult as I need a way of simulating keyboard events.

@MrJaba
Copy link

MrJaba commented Feb 19, 2014

I've just run into this issue whilst writing some tests for my application. Most suggestions are to create a jQuery.Event('keydown') and trigger this on the active element, however this doesn't seem to work? Any ideas why?

@MrJaba
Copy link

MrJaba commented Feb 19, 2014

As a quick follow up to this, I've finally found an incantation that works if anyone else runs into this issue then: http://jsbin.com/awenaq/3/edit will trigger the KeyboardJS.on event handlers

@RobertWHurst
Copy link
Owner Author

@MrJaba I could be wrong here, but I believe jQuery.Event only triggers jQuery bindings. Since KeyboardJS is bound to the DOM directly it doesn't receive the event created by jQuery.

@MrJaba
Copy link

MrJaba commented Feb 20, 2014

I think you may well be right, I couldn't get it to work anyway. Hopefully once I've got all of my code tested I could write some for KeyboardJS too and send a pull request

@RobertWHurst
Copy link
Owner Author

Sounds good. I'll checkout any pull request you make.

@RobertWHurst
Copy link
Owner Author

Added in the pending KeyboardJS 2 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants