{"size": 837, "ext": "js", "max_stars_repo_path": "frontend-apps/10/25/app/extras/grader.js", "max_stars_repo_name": "gavar/google-front-end-web-developer", "max_stars_repo_stars_event_min_datetime": "2018-10-18T05:01:02.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-19T19:06:20.000Z", "max_issues_repo_path": "frontend-apps/10/25/app/extras/grader.js", "max_issues_repo_name": "gavar/google-front-end-web-developer", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend-apps/10/25/app/extras/grader.js", "max_forks_repo_name": "gavar/google-front-end-web-developer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.8620689655, "max_line_length": 88, "alphanum_fraction": 0.6869772999}
try {
  var brick = document.querySelector(".brick-1x1");
  var buyButton = brick.querySelectorAll("button")[0];
  var returnButton = brick.querySelectorAll("button")[1];
  var itemsShouldBeReturned = false;

  buyButton.click();
  buyButton.click();
  buyButton.click();
  buyButton.click();

  if (brick.classList.toString().indexOf("low-stock") >= 0) {
    itemsShouldBeReturned = true;
    window.dispatchEvent(new CustomEvent("buy-button-works", {"detail": "passed"}));
  }

  returnButton.click();
  returnButton.click();
  returnButton.click();
  returnButton.click();

  if (brick.classList.toString().indexOf("low-stock") === -1 && itemsShouldBeReturned) {
    window.dispatchEvent(new CustomEvent("return-button-works", {"detail": "passed"}));
  }
}
catch (e) {
  console.log("some elements are not ready to be tested yet");
}
