testCreateOkEventFail() {
    dialog = createTestDialog();
    /** @suppress {visibility} suppression added to enable type checking */
    dialog.createOkEvent = () => {  // Override our mock createOkEvent.
      return null;
    };
    mockCtrl.$replayAll();

    dialog.show();
    events.fireClickSequence(dialog.getOkButtonElement());
    assertOpen(
        'Dialog should not be closed because OK event creation failed', dialog);

    mockCtrl.$verifyAll();  // Verifies that no event was dispatched.
  }
Tests that if creating the OK event fails, no event is dispatched and the
dialog doesn't close.
@suppress {visibility} suppression added to enable type checking