Failing Test Case But Getting Desired Result - Cash Register Project

I am failing 3 test cases, Test Case 8, 9, and 10 on the Cash Register Project, but my output is the same as the expected results. Why is it not passing? Please help.

Test case 8
CashRegProject_01

Test case 9
CashRegProject_03

Test case 10
CashRegProject_05

JavaScript code here

// let price = 1.87;   //1.87
// let cid = [
//   ["PENNY", 1.01],
//   ["NICKEL", 2.05],
//   ["DIME", 3.1],
//   ["QUARTER", 4.25],
//   ["ONE", 90],
//   ["FIVE", 55],
//   ["TEN", 20],
//   ["TWENTY", 60],
//   ["ONE HUNDRED", 100]
// ];
 
//TEST CASE 6
//   let price = 19.5; 
//   let cid = [
//   ["PENNY", 1.01],
//   ["NICKEL", 2.05],
//   ["DIME", 3.1],
//   ["QUARTER", 4.25],
//   ["ONE", 90],
//   ["FIVE", 55],
//   ["TEN", 20],
//   ["TWENTY", 60],
//   ["ONE HUNDRED", 100]
// ];

// TEST CASE 7 
//   let price = 3.26; 
//   let cid = [
//   ["PENNY", 1.01],
//   ["NICKEL", 2.05],
//   ["DIME", 3.1],
//   ["QUARTER", 4.25],
//   ["ONE", 90],
//   ["FIVE", 55],
//   ["TEN", 20],
//   ["TWENTY", 60],
//   ["ONE HUNDRED", 100]
// ];
 
//TEST CASE 8 
// let price = 19.5;
//    let cid = [
//   ["PENNY", 0.01],
//   ["NICKEL", 0],
//   ["DIME", 0],
//   ["QUARTER", 0],
//   ["ONE", 0],
//   ["FIVE", 0],
//   ["TEN", 0],
//   ["TWENTY", 0],
//   ["ONE HUNDRED", 0]
// ];

//TEST CASE 9
// let price = 19.5;
// let cid = [
//   ["PENNY", 0.01],
//   ["NICKEL", 0],
//   ["DIME", 0],
//   ["QUARTER", 0],
//   ["ONE", 1],
//   ["FIVE", 0],
//   ["TEN", 0],
//   ["TWENTY", 0],
//   ["ONE HUNDRED", 0]
// ];

//TEST CASE 10
let price = 19.5;
let cid = [
  ["PENNY", 0.5],
  ["NICKEL", 0],
  ["DIME", 0],
  ["QUARTER", 0],
  ["ONE", 0],
  ["FIVE", 0],
  ["TEN", 0],
  ["TWENTY", 0],
  ["ONE HUNDRED", 0]
];

const purchaseBtn = document.getElementById("purchase-btn");
const priceTotal = document.querySelector(".cr-total-rect-3");
const changeDue = document.getElementById("change-due");
const cashInput = document.getElementById("cash");
const crScreen = document.querySelector(".cr-screen");
let changeWorthArr = [100, 20, 10, 5, 1, .25, .1, .05, .01];
let checker = true;

priceTotal.textContent = `Total: $${price}`;

let cidReverse = structuredClone(cid);
cidReverse = cidReverse.reverse();
cidReverse.forEach((el)=>{
  el[1] = Math.ceil(el[1] * 100);
});
console.log("cidReverse output: ", cidReverse); //TEST
console.log("--------------------");
console.log("cid output: ",cid);   //TEST
console.log("--------------------");

const changeOutput = () =>{
  let dueChange = Math.round((parseFloat(cashInput.value) - price) * 100); 
  let cidTotal = cidReverse.reduce((acc,el)=>acc+el[1],0);
  let tempCidReverse = structuredClone(cidReverse);
  // console.log("tempCidReverse Before: ", tempCidReverse);//TEST
  console.log("CID Total: " , cidTotal); //TEST
  console.log("Due change: ", dueChange); //TEST
  changeDue.innerHTML = "";

  if(cidTotal < dueChange){
    changeDue.innerHTML = `<p>Status: INSUFFICIENT_FUNDS</p>`;
    return;
  }else if(cidTotal === dueChange){
    changeDue.innerHTML = `<p>Status: CLOSED</p>`;
  }else if(cidTotal > dueChange){
    changeDue.innerHTML = `<p>Status: OPEN</p>`;
  } 
    
  for(let i =0; i < cidReverse.length; i++){
    let count = 0;
    while(cidReverse[i][1] > 0){
      let tempChangeWorth = changeWorthArr[i] * 100;
      if(dueChange >= tempChangeWorth){
        dueChange = dueChange - tempChangeWorth;
        // console.log(`cidReverse[${i}][1] before: ` ,cidReverse[i][1]); //TEST
        cidReverse[i][1] = cidReverse[i][1] - tempChangeWorth;
        //console.log(`cidReverse[${i}][1] after: ` ,cidReverse[i][1]);  //TEST
        count = count + tempChangeWorth;
        // console.log("change: " + cidReverse[i][0] + " | element: " + i + " | change due:", count);
        // console.log(`cidReverse[${i}][1] after: ` ,cidReverse[i][1]);  //TEST
      }else{
        break;
      }
    }
    if(count > 0){
      changeDue.innerHTML += `<p>${cidReverse[i][0]}: $${count/100}</p>`;
    }
  }
  console.log("Due change: ",dueChange); //TEST
  if(dueChange > 0){
    changeDue.innerHTML = `<p>Status: INSUFFICIENT_FUNDS</p>`;
    console.log("Insufficient funds 2 check");
    // updateCID(cidReverse, cid);
    // console.log("tempCidReverse After: ", tempCidReverse); //TEST
    cidReverse = [...tempCidReverse];
    // console.log("cidReverse Updated: ", cidReverse); //TEST
  }
};

const checkCashInput = () =>{
  if(parseFloat(cashInput.value) < price){
    alert("Customer does not have enough money to purchase the item");
    checker = false;
  }else if(parseFloat(cashInput.value) === price){
    changeDue.textContent = "No change due - customer paid with exact cash";
    checker = false;
  }
};
  
const changeInDrawer = () =>{ 
  crScreen.innerHTML = `
  <p class="cid-p"><b>Change in drawer:</b></p>
  <p class="cid-p">Pennies: $${(cid[0][1]).toFixed(2)}</p>
  <p class="cid-p">Nickles: $${(cid[1][1]).toFixed(2)}</p>
  <p class="cid-p">Dimes: $${(cid[2][1]).toFixed(2)}</p>
  <p class="cid-p">Quarters: $${cid[3][1]}</p>
  <p class="cid-p">Ones: $${cid[4][1]}</p>
  <p class="cid-p">Fives: $${cid[5][1]}</p>
  <p class="cid-p">Tens: $${cid[6][1]}</p>
  <p class="cid-p">Twenties: $${cid[7][1]}</p>
  <p class="cid-p">Hundreds: $${cid[8][1]}</p>
  `;
};
changeInDrawer();

const updateCID = (updateArr,updatedArrValues) =>{
  let i = 0;
  let j = updatedArrValues.length - 1;
  while(i < updateArr.length && j >=0){
    // updateArr[i][1] = Math.round(updatedArrValues[j][1]/100);
    updateArr[i][1] = updatedArrValues[j][1]/100;
    // updateArr[i][1] = updatedArrValues[j][1];
    //cid[i][1] = cidReverse[i][1];
    i++;
    j--;
  }
  //  console.log("updateArr result: " , updateArr);
   changeInDrawer(); 
};
// changeInDrawer();
 
purchaseBtn.addEventListener("click", ()=>{
  checkCashInput();
  if(checker){
    changeOutput();
  }else{
    checker = true;
  }
  // updateCID();
  updateCID(cid, cidReverse);
  console.log("cid check: ",cid); //TEST
  console.log("reverseCid check: ", cidReverse);
});   

HTML code here

<!DOCTYPE HTML>
<html lang="en">
  <head>
    <title>Cash Register</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <h1>Cash Register Project</h1>
    <div id="change-due"></div>
    <label for="cash">Enter Cash From Customer</label>
    <input id="cash" type="number">
    <button id="purchase-btn">Purchase</button>

    <div id="cr-container">
      <div class="cr-body">
        <div class="button-grid">
          <div class="btn-1"></div>
          <div class="btn-2"></div>
          <div class="btn-3"></div>
          <div class="btn-4"></div>
          <div class="btn-5"></div>
          <div class="btn-6"></div>
          <div class="btn-7"></div>
          <div class="btn-8"></div>
          <div class="btn-9"></div>
        </div>
        <!-- Displays the change in drawer -->
        <div class="cr-screen"></div>
      </div>
      <div class="cr-total-rect-1"></div>
      <div class="cr-total-rect-2"></div>
      <div class="cr-total-rect-3"></div>
      <div class="line"></div>
      <div class="receipt">
        <div class="r-line-1"></div>
        <div class="r-line-2"></div>
        <div class="r-line-3"></div>
      </div>
      <div class="cr-body-bottom">
        <div class="circle"></div>
      </div>
    </div>


    <script src="script.js"></script>
  </body>
</html>

I figured it out! :grin: The way the tests are set, the test cases are coded at the very bottom of the code, so I had to compensate for it.