Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 5

Tell us what’s happening:

I think there is 1 more unit test missing on resetGameBtn .
Somehow it passed without doing resetGameBtn.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const playerScoreSpanElement = document.getElementById("player-score");
const computerScoreSpanElement = document.getElementById("computer-score");
const roundResultsMsg = document.getElementById("results-msg");
const winnerMsgElement = document.getElementById("winner-msg");
const optionsContainer = document.querySelector(".options-container");
const resetGameBtn = document.getElementById("reset-game-btn");

function showResults(userOption) {
  roundResultsMsg.innerText = getRoundResults(userOption);
  computerScoreSpanElement.innerText = computerScore;
  playerScoreSpanElement.innerText = playerScore;

  // ------------ user entered code:  -------------
  if(playerScore === 3 || computerScore === 3){
    winnerMsgElement.innerText = playerScore === 3 ? "Player has won the game!" : "Computer has won the game!"
    optionsContainer.style.display = 'none'

    // line below missing, yet still pass the test
    // resetGameBtn.style.display = 'block' 
  }
  // ------------ user entered code:  -------------

};

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Challenge Information:

Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 5

1 Like

Does this work to solve the problem in the program? It just may be a test case error.

HI @WongYC-66 !

Thanks for catching this.
There is currently an assertion for the resetGameBtn but I refactored it here and now it seems to be working correctly

1 Like