DEV Community

Discussion on: Ember.js in-element feature

Collapse
 
baukereg profile image
Bauke Regnerus

A little late, but thanks for this blog. I just swapped ember-wormhole for in-element. The example with @renderOut was quite useful to replace wormhole's renderInPlace argument.

One thing I noticed is that using in-element can break tests, as assert.dom() doesn't seem to find the right element anymore. Since I use a component as abstraction to in-element, I enforce to render in place for tests.

get _renderInPlace() {
    const config = getOwner(this).resolveRegistration('config:environment');
    if (config.environment === 'test') {
        return true;
    }
    return this.args.renderInPlace;
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
jeffdaley profile image
Jeff Daley • Edited

This might depend on your renderOut target. If you use document.body, your modals will render outside the QUnit container and fail await find() references. If you use document.querySelector('.ember-application'), you should be good (at least that's the case for me).