lundi 21 mai 2018

How to catch actions in rendering test?

I am adding tests to an existing Ember app which uses the old bubbling style actions. Eventually I want to change these to closure actions, and explicit passing of functions. Until then I need to know how to catch when an action is bubbled from a sub-component.

Previously I was able to use this.on() inside the test. However, with the new setupRenderingTest style, this.on does not exist anymore.

The components are using sendAction to fire an action identified by a string name. The parent context is catching the action in it's actions hash. I need to do the same in the test.




Aucun commentaire:

Enregistrer un commentaire