HELP Please! 25+5 Clock Audio Errors

Hi
I need the help of some expert eyes and minds to solve the code errors that I am getting below. Much appreciated, thanks!!! :slight_smile:

My project link:

These are 2 User Story Tests that are failing at the moment:-

#Audio

  1. When a countdown reaches zero (NOTE: timer MUST reach 00:00), a sound indicating that time is up should play. This should utilize an HTML5

  2. The audio element with id=“beep” must be 1 second or longer.
    —Timeout of 2000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves.
    Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves.

Well, I don’t think the user stories are simply failing - you haven’t implemented the audio yet. When I run your code and the audio tries to run, I hear nothing and I get:

Uncaught (in promise) DOMException: The element has no supported sources.

in the browser console.

I think it’s a little weird to have an html element (your audio element) outside the React code. I would expect that to be in the JSX and use a ref to access it. But, ultimately I think your problem is the src you are using for the sound file - I was able to use a different one and get all the tests to pass.

Hi Kevin
I will search for another to change the src code and run the test again.

Thanks

Hi
I figured it out and edited the codes for my audio element, changed the src and i passed 29/29.

Thanks for your input Kevin.

1 Like

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