You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ember-cli, test helpers are made available for integration tests by calling startApp(). Ember test helpers are not available for unit tests, nor is it appropriate to call startApp() within a unit test.
However, because unit tests for Ember components rely on the component being tested to exist as part of the DOM, a subset of test helper methods are actually useful in that context - for example, fillIn() or find() (conversely, other test helpers like visit() still do not make sense in the context of a component unit test).
It would be useful to expose an appropriate subset of DOM-related test helpers, scoped to the component being tested (e.g. this.fillIn('selector', 'value'), since the component being tested exists as part of the DOM.
The text was updated successfully, but these errors were encountered:
I hate bumping issues because I realize everyone is really busy. But I think this still makes a lot of sense; especially with the recently added { integration: true } for components. I've done some looking around but haven't rolled over the correct rock yet. If I could be pointed in the right direction, i'd be happy to open a pull request. (if it is feasible)
I'm having a similar issue where I have a custom helper that I'd like to expose in my unit tests. It would be very helpful to not have to register it in every file.
The easiest way to get these helpers immediately is by using the ember-native-dom-helpers addon. In a future iteration (after another testing RFC) ember-test-helpers will provide them directly...
In ember-cli, test helpers are made available for integration tests by calling
startApp()
. Ember test helpers are not available for unit tests, nor is it appropriate to callstartApp()
within a unit test.However, because unit tests for Ember components rely on the component being tested to exist as part of the DOM, a subset of test helper methods are actually useful in that context - for example,
fillIn()
orfind()
(conversely, other test helpers likevisit()
still do not make sense in the context of a component unit test).It would be useful to expose an appropriate subset of DOM-related test helpers, scoped to the component being tested (e.g.
this.fillIn('selector', 'value')
, since the component being tested exists as part of the DOM.The text was updated successfully, but these errors were encountered: