I can’t get two tests to pass, even though the code does accomplish what those tests ask for. The test suite times out before confirming that a click of the “new-quote” button puts the proper data into the #quote and #author elements. Could someone help me figure out why this is the case?
I have been able to get this project to work before without using React, but it’s important to me that I use React this time. I really hope I’m able to find a solution that keeps React. Here is a link to a version of the project:
Please refrain from criticizing the fact that the data is local instead of being called from a quote database, as well as the lack of styling so far. I’m working on those parts right now.
The reason your tests are not passing is because you are using React. This project is not meant for that. The test is looking at the real static HTML to see if the ids match and they are not there until React renders them.
This is meant to be a beginner project and is supposed to use HTML/CSS/pure JS only
As stated in the assignment
Additional technologies (just for example jQuery, React, Angular, or Vue) are not recommended for this project, and using them is at your own risk. Other projects will give you a chance to work with different technology stacks like React.
I don’t believe there is a way to make this work with React because the test is looking for static HTML id’s. You might be able to fool the test but that goes beyond the scope of this assignment
EDIT: Correction you can probably make this work with React if you manually insert the pre-rendered HTML into the HTML section, but that seems like needless work.
The complete text is:
It’s pretty simply. The test seems to make sure that the button works more than once, which was not the case with the code I posted here. Updating the method so that the quote+author were renewed each time the button is pressed fixed it.