Build a cash register project - Project doesn't finish

Hello, I’ve completed the JavaScript cash register project, I’ve run all of the tests successfully and when I click the “Run the Tests” button the tests run and the console outputs:

[ReferenceError: price is not defined]
[ReferenceError: price is not defined]
[ReferenceError: price is not defined]
[ReferenceError: price is not defined]
[ReferenceError: price is not defined]
[ReferenceError: price is not defined]
[ReferenceError: price is not defined]

I’ve made some changes to the code and it still outputs these errors, however I can’t seem to replicate the errors while running the tests myself

Is the problem in the code?

HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="./styles.css">
    <title>Cash Register</title>
  </head>
  <body>
    <div>
      <input id = "cash" type = "number"/>
      <button id = "purchase-btn">Purchase</button>
      <div id = "change-due">
      </div>
    </div>
    <script src="./script.js"></script>
  </body>
</html>

JavaScript:

document.addEventListener("DOMContentLoaded", function() {
  let price = 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]
  ];

  const cash = document.getElementById('cash');
  const checkButton = document.querySelector('#purchase-btn');
  const result = document.querySelector("#change-due");

  // initialize buttons
  checkButton.onclick = checkInput;

  function checkInput(){
    if(cash.value < price){
      result.innerText = "Customer does not have enough money to purchase the item";
    } else if (cash.value == price){
      result.innerText = "No change due - customer paid with exact cash";
    } else {
      const changeDue = getChange(price, cash.value, cid);
      displayChangeStatus(changeDue);
    }
  }

  function getChange(price, cash, cid) {
      const denominations = {
          "PENNY": 0.01,
          "NICKEL": 0.05,
          "DIME": 0.1,
          "QUARTER": 0.25,
          "ONE": 1,
          "FIVE": 5,
          "TEN": 10,
          "TWENTY": 20,
          "ONE HUNDRED": 100
      };

      let change = cash - price;
      let changeArr = [];

      // Iterate through each currency unit in CID
      for (let i = cid.length - 1; i >= 0; i--) {
          const currency = cid[i][0];
          const unitValue = denominations[currency];
          let available = cid[i][1];
          let numUnits = 0;

          // Calculate the maximum number of units we can give as change
          while (change >= unitValue && available > 0) {
              change -= unitValue;
              change = Math.round(change * 100) / 100;
              available -= unitValue;
              numUnits += unitValue;
          }

          // If we've used any of this currency, add it to the change array
          if (numUnits > 0) {
              changeArr.push([currency, numUnits]);
          }
      }

      // If there's still change remaining, it means we don't have enough change
      if (change > 0) {
          return { status: "INSUFFICIENT_FUNDS", change: [] };
      }

      // If all change was successfully given, check if there's any remaining in the drawer
      const remainingInDrawer = cid.reduce((acc, curr) => acc + curr[1], 0);
      if (remainingInDrawer === 0) {
          return { status: "CLOSED", change: changeArr };
      }

      // Return change and status "OPEN"
      return { status: "OPEN", change: changeArr };
  }

  function displayChangeStatus(changeDue) {
      const changeDueDiv = document.getElementById('change-due');

      if (changeDue.status === "INSUFFICIENT_FUNDS") {
          changeDueDiv.innerText = "Status: INSUFFICIENT_FUNDS";
      } else if (changeDue.status === "CLOSED") {
          changeDueDiv.innerText = "Status: CLOSED";
      } else {
          let changeStr = "Status: OPEN ";
          for (let i = 0; i < changeDue.change.length; i++) {
              changeStr += `${changeDue.change[i][0]}: $${changeDue.change[i][1].toFixed(2)} `;
          }
          changeDueDiv.innerText = changeStr.trim();
      }
  }
});

You moved these from the original location they were give in, which breaks all of the tests.