Skip to content

Commit 06aba0f

Browse files
committed
Error happens in a strict-only environment as well
1 parent e676fff commit 06aba0f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

packages/@ember/-internals/glimmer/tests/integration/components/render-component-test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,39 @@ moduleFor(
594594
expect: '<div data-one="">3</div><div data-two="">3</div>',
595595
});
596596
}
597+
598+
'@test rendering multiple times to adjacent elements'() {
599+
let aHelper = (str: string) => str.toUpperCase();
600+
let Child = defComponent(`Hi: {{aHelper "there"}}`, { scope: { aHelper } });
601+
let get = (id: string) => this.element.querySelector(id);
602+
function render(Comp: GlimmerishComponent, id: string, owner: Owner) {
603+
renderComponent(Comp, {
604+
into: get(`#${id}`)!,
605+
owner,
606+
});
607+
}
608+
let A = defComponent('a:<Child />', { scope: { Child } });
609+
let B = defComponent('b:<Child />', { scope: { Child } });
610+
let Root = defComponent(
611+
[
612+
`<div id="a"></div><br>`,
613+
`<div id="b"></div>`,
614+
`{{render A 'a' owner}}`,
615+
`{{render B 'b' owner}}`,
616+
].join('\n'),
617+
{ scope: { render, A, B, owner: this.owner } }
618+
);
619+
620+
this.renderComponent(Root, {
621+
expect: [`<div id="a">a:Hi: THERE</div><br>`, `<div id="b">b:Hi: THERE</div>`, ``, ``].join(
622+
'\n'
623+
),
624+
});
625+
626+
run(() => destroy(this));
627+
628+
assertHTML('');
629+
}
597630
}
598631
);
599632

0 commit comments

Comments
 (0)