Why i am noit passing this test (test no 12)

  1. When a session countdown reaches zero (NOTE: timer MUST reach 00:00), and a new countdown begins, the element with the id of “timer-label” should display a string indicating a break has begun.
    Timer has reached zero but didn’t switch to Break time: expected ‘Break’ to not equal ‘Break’
    AssertionError: Timer has reached zero but didn’t switch to Break time: expected ‘Break’ to not equal ‘Break’
    at Proxy.h (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123)
    at Proxy.u (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130)
    at n.notStrictEqual (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:736)
    at n. (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:180030)
    at p (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539)
    at Generator. (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95876)
    at Generator.next (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902)
    at r (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169)
    at s (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1380)

here is my code - https://codepen.io/kulwinder5555/pen/xbKePxQ?editors=0011

You need to reset the timerLabel to the default initial value inside your reset handler.

i am exactly doing same

Where are you resetting the timerLabel element back to "Session" in your reset handler?

document.getElementById("reset").addEventListener("click", () => {
  //value reset
  beep.pause();
  beep.currentTime = 0;
  clearInterval(timeLeft);
  timeLeft = null;
  sessionValue = defaultSessionValue;
  breakValue = defaultBreakValue;
  sessionDisplay.innerHTML = sessionValue;
  breakDisplay.innerHTML = breakValue;
  time = sessionValue * 60;
  isSession = true;
  setTime();
});

Also, you have a typo in your switchSession function.

1 Like

Okay i got it now thanks bro