From dc1afeac89686284365a7a524211a728db9b8147 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 5 Sep 2024 11:18:21 +0200 Subject: [PATCH] FIX: ensures message field is rendering placeholders (#28753) A previous commit had broken this codepath, this commit ensures it's fixed and is adding a test. It's not testing the copy/paste behavior as fairly complex to test. --- .../admin/components/fields/da-message-field.gjs | 4 ++-- .../integration/components/da-message-field-test.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-message-field.gjs b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-message-field.gjs index e9c1ea2fea1..1a59a09e15f 100644 --- a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-message-field.gjs +++ b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-message-field.gjs @@ -24,8 +24,8 @@ export default class MessageField extends BaseField { {{#if this.displayPlaceholders}} {{/if}} diff --git a/plugins/automation/test/javascripts/integration/components/da-message-field-test.js b/plugins/automation/test/javascripts/integration/components/da-message-field-test.js index 260b5266286..ad655dffde9 100644 --- a/plugins/automation/test/javascripts/integration/components/da-message-field-test.js +++ b/plugins/automation/test/javascripts/integration/components/da-message-field-test.js @@ -24,4 +24,17 @@ module("Integration | Component | da-message-field", function (hooks) { assert.strictEqual(this.field.metadata.value, "Hello World"); }); + + test("render placeholders", async function (assert) { + this.field = new AutomationFabricators(getOwner(this)).field({ + component: "message", + }); + this.automation.placeholders = ["foo", "bar"]; + + await render( + hbs`` + ); + + assert.dom(".placeholders-list").hasText("foo bar"); + }); });