From faad8842d4a16d9d71de645eab93ae5460ad3039 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Fri, 31 May 2024 13:41:14 +0200 Subject: [PATCH] DEV: Avoid extra whitespace in rawRenderGlimmer (#27272) --- .../app/components/render-glimmer-container.gjs | 2 ++ .../tests/integration/helpers/raw-test.gjs | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/app/assets/javascripts/discourse/app/components/render-glimmer-container.gjs b/app/assets/javascripts/discourse/app/components/render-glimmer-container.gjs index 84efab4a79a..4ba5be51b4b 100644 --- a/app/assets/javascripts/discourse/app/components/render-glimmer-container.gjs +++ b/app/assets/javascripts/discourse/app/components/render-glimmer-container.gjs @@ -7,10 +7,12 @@ export default class RenderGlimmerContainer extends Component { diff --git a/app/assets/javascripts/discourse/tests/integration/helpers/raw-test.gjs b/app/assets/javascripts/discourse/tests/integration/helpers/raw-test.gjs index 3d1b8a2f675..d0642bcd739 100644 --- a/app/assets/javascripts/discourse/tests/integration/helpers/raw-test.gjs +++ b/app/assets/javascripts/discourse/tests/integration/helpers/raw-test.gjs @@ -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 = ; + + addRawTemplate("raw-test", () => + rawRenderGlimmer(this, "span.bar", SimpleTemplate) + ); + + await render(); + + assert.dom("span.bar").hasText(/^baz$/); + }); });