Hi Guys, i’m sure this gets asked a lot but i’ve tried searching and I can’t find an answer to my problem so i’m here for help.
I built my calculator using react + redux and hooks. It works fine, it does all the functions, and what it’s supposed to do, but I can’t seem to pass tests 11 and 12 (or 13 since 11 is duplicated) so i’d appreciate it if someone took a look at my code:
a quick run-through on how it works:
I have a container component and a button component,
they both pull id names and key symbols from a “library” object I built.
I have 3 states, currentKey, Input and Product, which are managed by redux.
all the calculations are done in the reducer, and I have an inputCorrect function to fix my inputs using regex which the reducer uses.
One of the errors says expected 10.5-5.5 to be 5 and not 145, when I run this test it is correct for me. so I added a console.log to my reducer to show what tests they run, and the tests does 150.5-5.5 instead of what it’s supposed to do.
On an unrelated note. the example calculator show “0” instead of “-” when you click it.