Skip to content

Commit

Permalink
Merge pull request #635 from simonihmig/empty-target
Browse files Browse the repository at this point in the history
Make portal target render as empty
  • Loading branch information
simonihmig committed May 1, 2023
2 parents 424a314 + 69d0b39 commit 9d8257f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 1 addition & 3 deletions ember-stargate/src/components/portal-target.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
{{did-insert this.register}}
{{will-destroy this.unregister}}
...attributes
>
{{yield this.count}}
</div>
>{{yield this.count}}</div>
8 changes: 8 additions & 0 deletions test-app/tests/integration/components/portal-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ module('Integration | Component | portal', function (hooks) {
assert.dom('#p2').hasText('foo');
});

test('a portal target renders as an empty div', async function (assert) {
await render(hbs`
<PortalTarget @name="main" id="portal" />
`);

assert.dom('div#portal:empty').exists();
});

test('a portal target renders only one portal by default', async function (assert) {
await render(hbs`
<PortalTarget @name="main" id="portal" />
Expand Down

0 comments on commit 9d8257f

Please sign in to comment.