DEV: Avoid extra whitespace in rawRenderGlimmer (#27272)

This commit is contained in:
Jarek Radosz 2024-05-31 13:41:14 +02:00 committed by GitHub
parent 81fe4ed248
commit faad8842d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -7,10 +7,12 @@ export default class RenderGlimmerContainer extends Component {
<template>
{{#each this.renderGlimmer._registrations as |info|}}
{{#in-element info.element insertBefore=null}}
{{~! no whitespace ~}}
<info.component
@data={{info.data}}
@setWrapperElementAttrs={{info.setWrapperElementAttrs}}
/>
{{~! no whitespace ~}}
{{/in-element}}
{{/each}}
</template>

View File

@ -89,4 +89,19 @@ module("Integration | Helper | raw", function (hooks) {
assert.true(willDestroyCalled, "component was cleaned up correctly");
});
test("does not add extra whitespace", async function (assert) {
const SimpleTemplate = <template>baz</template>;
addRawTemplate("raw-test", () =>
rawRenderGlimmer(this, "span.bar", SimpleTemplate)
);
await render(<template>
<RenderGlimmerContainer />
{{raw "raw-test"}}
</template>);
assert.dom("span.bar").hasText(/^baz$/);
});
});