Skip to content

Commit 3a53762

Browse files
committed
Reproduce renderComponent error: 'attempted to close a tracking frame, but one was not open'
1 parent 5da3f8a commit 3a53762

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,37 @@ moduleFor(
622622
this.renderComponent(Root, { expect: '' });
623623
}, /but that value was not in scope: a-helper/);
624624
}
625+
626+
'@test rendering multiple times to adjacent elements'(assert: Assert) {
627+
this.owner.register('helper:a-helper', (str: string) => str.toUpperCase());
628+
let Loose = defineComponent(null, `Hi: {{a-helper "there"}}`);
629+
let get = (id) => this.element.querySelector(id);
630+
function render(Comp: GlimmerishComponent, id: string, owner: Owner) {
631+
renderComponent(Comp, {
632+
into: get(`#${id}`),
633+
owner,
634+
});
635+
}
636+
let A = defComponent('a:<Loose />', { scope: { Loose } });
637+
let B = defComponent('b:<Loose />', { scope: { Loose } });
638+
let Root = defComponent(
639+
[
640+
`<div id="a"></div><br>`,
641+
`<div id="b"></div>`,
642+
`{{render A 'a' owner}}`,
643+
`{{render B 'b' owner}}`,
644+
].join('\n'),
645+
{ scope: { render, A, B, owner: this.owner } }
646+
);
647+
648+
this.renderComponent(Root, {
649+
expect: [`<div id="a">hi:a</div><br>`, `<div id="b">hi:b</div>`, ``, ``].join('\n'),
650+
});
651+
652+
run(() => destroy(this));
653+
654+
assertHTML('');
655+
}
625656
}
626657
);
627658

0 commit comments

Comments
 (0)