message: use test helpers to modify and reset Ember.onerror in tests
diff: /* eslint-disable @typescript-eslint/no-non-null-assertion */
  import { module, test } from 'qunit';
  import { setupRenderingTest } from 'ember-qunit';
  -import { click, render, focus, triggerKeyEvent } from '@ember/test-helpers';
  +import {
  + click,
  + render,
  + focus,
  + triggerKeyEvent,
  + setupOnerror,
  + resetOnerror,
  +} from '@ember/test-helpers';
  import { hbs } from 'ember-cli-htmlbars';
  -import Ember from 'ember';
  module('Integration | Component | Dropdown', function (hooks) {
  setupRenderingTest(hooks);
  @@ -12,11 +18,8 @@ module('Integration | Component | Dropdown', function (hooks) {
  const CLOSE_BUTTON = '[data-test-close-button]';
  const LINK_OUTSIDE = '[data-test-link-outside]';
  const LINK_INSIDE = '[data-test-link-inside]';
  - let onerror: typeof Ember['onerror'];
  hooks.beforeEach(async function (this) {
  - onerror = Ember.onerror;
  -
  await render(hbs`
  <a data-test-link-outside href="#">Control</a>
  <Boxel::Dropdown>
  @@ -35,9 +38,9 @@ module('Integration | Component | Dropdown', function (hooks) {
  `);
  });
  + module('test rendering errors', function (hooks) {
  hooks.afterEach(function () {
  - // reset Ember.onerror
  - Ember.onerror = onerror;
  + resetOnerror();
  });
  // This test is important because event handlers are assigned assuming default HTML button behaviour
  @@ -46,9 +49,9 @@ module('Integration | Component | Dropdown', function (hooks) {
  // https://github.com/emberjs/ember-test-helpers/issues/1054
  test('it errors if it receives a non-button element', async function (assert) {
  let lastError: Error;
  - Ember.onerror = (e: Error) => {
  + setupOnerror((e: Error) => {
  lastError = e;
  - };
  + });
  await render(hbs`
  <Boxel::Dropdown>
  @@ -68,6 +71,7 @@ module('Integration | Component | Dropdown', function (hooks) {
  'Only buttons should be used with the dropdown modifier'
  );
  });
  + });
  test('it renders dropdown trigger, but not dropdown content at initialization', async function (assert) {
  assert.dom(TRIGGER).isVisible().containsText('Trigger');
  