Completed "Build a Random Quote Machine"

https://codepen.io/DKPK/pen/jOyPVwZ

Is it looking nice?

1 Like

Hi,

I can’t say that the design is good. But it is working :slight_smile:
One thing I would change is that you can put some words instead of default at the beginning. and add title about the project.

1 Like

Thanks for the feedback :slightly_smiling_face:

Were kinda sloppy when I did it.

Your quote machine looks okay @amejl172. Some things to revisit;

  • The test script, with all tests passing, should be included when you submit your projects.
    • Your page passes 10/12 user stories. Click the red button to see which test(s) are failing and text to help you correct the issue.
    • Be sure and read more than just the first line of the failing message. The ability to read and comprehend error messages is a skill you’ll need to acquire as a developer. Ask questions on what you don’t understand.
  • Make the page responsive
1 Like

Sometimes it gives 12/12 , sometimes 10/12 and sometimes 11/12.

The issue is timeout.

From what I can see the 10/12 should always be so because of the error messages;

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. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

and

On first load, my quote machine displays the random quote's author in the element with id="author".
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. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

On first load there is no quote and hence, no author. The tests say what they’re looking for.

1 Like

Now I get it, but what I don’t understand is why it gives 11/12?

I was just getting ready to edit my reply to further say that when the tests fail the first time a subsequent run will pass 12/12 because the tests load a quote and now there is a quote and an author. It thinks it’s the initial run.

I don’t know why you’re seeing the 11/12. I cannot duplicate that. What is the failing message?
The entire failing message, not just the first line.

1 Like

This is what its says

Script error. (:0)
Error: Script error. (:0)
at a.onerror (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:593:1177)

I think it’s because I tapped 2 times on “Run Tests”

If I tap 2 times then I don’t get 12/12.

I was able to get 11/12 but this is the error I see;

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. 
Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

It’s also the 8th test but the message is different that what you posted…and gives additional info on why it’s failing.

1 Like

I think it’s because you tapped 1 time and I tapped 2 times.

Yes, I tapped 1 time, and got same as you.

The reason it gets timeouts is probably, because I didn’t use React in this challenge.

I see. The instructions do say “You should use a frontend framework (like React for example) because this section is about learning frontend frameworks.”

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.