[SOLVED] Random Quote Machine still fail test 6 and 8

Hello everyone, I know this question have been asked many times in forum but I still get the same fail test 6 and 8.

Could please anyone look at my code and tell where’s the problem?

Any help would be appreciate

Test :
6. On first load, my quote machine displays a random quote in the element with id=“text”.
Timeout of 15000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves.
Error: Timeout of 15000ms exceeded.

  1. When the #new-quote button is clicked, my quote machine should fetch a new quote and display it in the #text element.

Timeout of 15000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves.

Code:

Do you have a link to a pen or repo or somewhere we can see all the code?

Oh yes, sorry I forgot attach my repo

Link to repo
GetQuote.js

Link to production
https://random-quotemachine.netlify.app/

OK, so the first test that fails is:

On first load, my quote machine displays a random quote in the element with id=“text”.

I look in your code and I see:

        <div className="quote-text">
          <i className="fa fa-quote-left"> </i>{this.state.text}<span id="text"></span>
        </div>

Do you see the problem? The test is looking for the quote here: <span id="text"></span>. But that is not where you are putting it.

When I fix that, the tests pass.

Ah I see, my old habbit not looking the code thoroughly. Thank you for your solution and thoroughness friend :+1: :+1: :+1:

1 Like