Can't pass two tests though everything works correctly

I am out of ideas. Why this tests are not fulfilled?

  1. The audio element with id of “beep” must stop playing and be rewound to the beginning when the element with the id of “reset” is clicked.
    Audio element was not stopped when reset was clicked.: expected false to be true
    AssertionError: Audio element was not stopped when reset was clicked.: expected false to be true
    at o. (
    at o.e (
    at Reflect.get ()
    at Object.e [as get] (
    at n.isTrue (
    at n. (
    at (
    at CC.runTest (

And I CAN stop the sound by clicking reset element and it stops and being rewound as is asked.

This is my pen

Your audio file is the issue and here is a link that might help.

1 Like

The trick with the ref didn’t worked out. But again - the audio file that I have took from the link in the example progect of FCC stops playing when I CLICK the reset element - whenever I use the Ref or documnet.getElementById - and test doesn’t pass nevertheless.

Thank you so much for your help :smiling_face:

1 Like

I feel like something is going on behind the scenes of this code. But cannot catch it. I think it is connected to the fact that after all tests finished beep continues to beep - may be in some cases my stop code for the sound has no action… Please help! :melting_face: :melting_face: :melting_face:

Clicking the reset button should pause and set the currentTime property of the element to 0.

How you want to do that is up to you but just to prove it, simply adding the direct DOM manipulation to the reducer will make it pass.

case ActionTypes.reFresh:
	document.getElementById('beep').currentTime = 0;
	return initialState;
1 Like

Thank you so much for helping me so many times! it worked, though I don’t understand why my solution didn’t? is it appropriate to add code in reducer like that?

Not really considering the reducer is supposed to be pure and DOM manipulation is not part of its responsibility, only state updates. That is why I said it was just “proof” of the issue.

1 Like