Tests #7 and #8 for Calculator

This isn’t the finished product but I’m very confused about why tests numbers 7-9 aren’t passing.

Components pass only strings in state and props (at least, as far as I can tell from logging). Numbers are only numbers at the site of computation.

I don’t think this is a React 18 issue as reverting back to React 17 didn’t fix the issue.

Here’s the live site

Here’s my App.js

The test suite works the same for React 18 and 17. Anybody have any ideas? Should I just rewrite it with Class components or just move on with my life and forget about getting this cert?

I’m wondering if some of the changes made to the tests to help with React 18 made things worse for functional components?

I see issues with your app that may or may not being causing tests to fail.

If I click any number on the key pad, click the * and then click the * again, the displays shows 0. If I click any number on the key pad, click the / and another number on the keypad and then keep clicking / enough times, it will eventually show 1.

1 Like

Thank you for taking the time Randell! There are a few guardrails that haven’t been put in place, but the element with id=“display” always accepts inputs and the “clear” button works in every case I can think of. With the other projects I was able to just fulfill the user stories one at a time but I seem to be up against a wall with this and I’m wondering if others have solved this with only hooks recently? Or if there is something glaringly wrong with my code that I just don’t see when it comes to User Stories 7 and 8 in particular.