function checkSelectDispatchedOnButtonClick(disableButton) {
  const aButton =
      dom.getElementsByTagName(TagName.BUTTON, dialog.getButtonElement())[0];
  assertNotEquals(aButton, null);
  aButton.disabled = disableButton;
  let wasCalled = false;
  const callRecorder = () => {
    wasCalled = true;
  };
  events.listen(dialog, Dialog.EventType.SELECT, callRecorder);
  testingEvents.fireClickSequence(aButton);
  return wasCalled;
}
Helper that clicks the first button in the dialog and checks if that
results in a Dialog.EventType.SELECT being dispatched.
@param {boolean} disableButton Whether to disable the button being tested.
@return {boolean} Whether a Dialog.EventType.SELECT was dispatched.