JavaScript Calculator - passes manually but tests in module failing [SOLVED]

Tell us what’s happening:
I have built the JavaScript Calculator in CodePen. As far as I can tell I have met all (or most of) the tests but for some reason they are not passing in the test module. I haven’t used react, just jQuery, and the code is a bit “hacky”, but as far as I can tell the tests should be passing (they certainly seem to be manually. I have also tried spitting out some output into the console to provide further checks. Any help or pointers to what I am missing would be gratefully received. Thanks

Your code so far

Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:

I noticed that in your code you are using mouseup and mousedown handlers. It’s possible that the testing library is dispatching the click event to test. Try to rewrite your code using click events.

1 Like

Thank you so much for taking the time to look. You were spot on. Simple change from mousedown to click (even leaving mouseup in) and all tests now passing! Thanks again.

1 Like