The second view correctly displays the pet’s name in the element with className=“pet-name”, but the test still fails.
For the PetMood enum, I used a string workaround to pass the test, even though it is part of the code.
How can I pass the test.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: index.tsx */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Challenge Information:
Build a Digital Pet Game - Build a Digital Pet Game
Please update the message to include your code. The code was too long to be automatically inserted by the help button.
When you enter a code, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
I have a related issue and I am not sure if I should add a new post. The way I organized the switch between the “form view” (where the pet name is entered) and the “second view” (where the rest of the app is implemented) is a ternary operator (condition ? yes : no). This works as expected but is not accepted by the test runner.
If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.
The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.