ember-table icon indicating copy to clipboard operation
ember-table copied to clipboard

migrate native DOM interaction to @ember/test-helpers [tests]

Open efx opened this issue 6 years ago • 1 comments

As a developer, I would like to run the test suite without seeing deprecations:

ok 174 Chrome 75.0 - [246 ms] - Integration | selection > misc: selecting all children selects the parent when enabled
    ---
        Log: |
            { type: 'warn',
              text:
               '\'DEPRECATION: Importing `click` from "ember-native-dom-helpers" is deprecated. Since `ember-cli-qunit` 4.3 and `ember-cli-mocha` 0.15.0 you can use `import { click } from "@ember/test-helpers";` [deprecation id: ember-native-dom-helpers-click]\\n        at logDeprecationStackTrace (http://localhost:7357/assets/vendor.js:31971:21)\\n        at HANDLERS.<computed> (http://localhost:7357/assets/vendor.js:32199:9)\\n        at raiseOnDeprecation (http://localhost:7357/assets/vendor.js:32001:14)\\n        at HANDLERS.<computed> (http://localhost:7357/assets/vendor.js:32199:9)\\n        at invoke (http://localhost:7357/assets/vendor.js:32211:9)\\n        at Object.deprecate (http://localhost:7357/assets/vendor.js:32065:24)\\n        at click (http://localhost:7357/assets/test-support.js:16648:32)\\n        at Object.clickWith (http://localhost:7357/assets/test-support.js:18252:48)\\n        at Object.selectRange (http://localhost:7357/assets/test-support.js:18507:47)\'\n' }

We should migrate away from ember-native-dom-helpers in favor of @ember/test-helpers.

https://github.com/Addepar/ember-table/blob/b7d56a65fcb81c6d383f7747bd16cba5bd495f58/addon-test-support/pages/-private/ember-table-body.js#L4 and other examples should become

import { click } from '@ember/test-helpers';

We'll need to audit which functions @ember/test-helpers does not provide. scrollTo is one of them.

efx avatar Jul 22 '19 17:07 efx

  1. I for some reason did not see these logged upon running yarn test or ember test.
  2. The test application relies upon [email protected]+bc8d50e2, and so bundles an older version of @ember/test-helpers. We should update that before embarking on this task.

I found that the new click method doesn't swap in easily in some tests like this one. It could be from those tests using an older API style than the unified test one. Similar to the first update we should update the testing APIs to one standard before migrating usage.

ghost avatar Jul 26 '19 18:07 ghost