Test results in Metamorph error


#1

A test which basically runs the same actions as one does when interacting with the app results in the following error:

“Cannot perform operations on a Metamorph that is not in the DOM.”

While in fact performing the following:

```find(‘dom selector’).first().click()````

The dom element i perform the find on is not a metamorph tag anymore, I’ve checked that. However there are metamorph elements inside of it.


#2

Seems like this results from a not clean start state of the test. I’ve included App.reset now in the module setup but then the tests hang after one test.


#3

It would be easier to help with a bit more context to your test - can you create a jsbin to demonstrate the failure?

In any case, you probably want to use Ember’s click helper rather than triggering a click via jQuery. Triggering a click on your app will cause Ember to start a run-loop which will update the state of your app - this takes an unknown amount of time (because it depends on the complexity of your bindings) so it runs asynchonously. Ember’s click() helper manages this for you by returning a promise that will resolve when all that work is done.

HTH /Eoin/