freeCodeCamp / testable-projects-fcc

Test suite for freeCodeCamp's legacy Codepen-based Curriculum
BSD 3-Clause "New" or "Revised" License
177 stars 112 forks source link

Drum Machine Keypress test Failure #891

Closed philtrem closed 4 years ago

philtrem commented 5 years ago

Issue Description

Open the pen and run the tests to see what the issue is. The test fails while it shouldn't. You can verify this yourself.

if I match keypress with id (match with capital letter), the test passes ALTHOUGH the functionality is broken. Whereas if I implement it correctly by matching on the lowercase letter, the test doesn't pass.

Your Code / Link to Your Pen

https://codepen.io/philtrem/pen/vwXqJE

philtrem commented 5 years ago

I made a pull request to fix this issue: https://github.com/freeCodeCamp/testable-projects-fcc/pull/892

edit: to fix this issue on my end, I forked my codepen and changed the code to account for both cases ie:

    if (e.key === id || e.key === id.toLowerCase()) { ... }
moT01 commented 4 years ago

For more visibility, please open issues on the main repo for these. Thanks and happy coding 🎉