diff --git a/ember-basic-dropdown/src/components/basic-dropdown-wormhole.ts b/ember-basic-dropdown/src/components/basic-dropdown-wormhole.ts index 6a05a3b2..395884c3 100644 --- a/ember-basic-dropdown/src/components/basic-dropdown-wormhole.ts +++ b/ember-basic-dropdown/src/components/basic-dropdown-wormhole.ts @@ -10,24 +10,11 @@ export default class BasicDropdownWormholeComponent extends Component `); - let id = '#ember-testing'; - if (config.APP.shadowDom) { - id = '#ember-basic-dropdown-wormhole'; - } + assert + .dom('#ember-basic-dropdown-wormhole', this.element.getRootNode()) + .exists('wormhole is present'); + }); - assert.dom(id, this.element.getRootNode()).exists('wormhole is present'); + test('Uses custom destination from config if present', async function (assert) { + config['ember-basic-dropdown'] = { + destination: 'custom-wormhole-destination', + }; + + await render(hbs``); + + assert + .dom( + '.ember-application #custom-wormhole-destination', + this.element.getRootNode(), + ) + .exists('custom destination is used'); + + assert + .dom( + '.ember-application #ember-basic-dropdown-wormhole', + this.element.getRootNode(), + ) + .doesNotExist('default destination is not used'); }); test('Has class my-custom-class', async function (assert) {