mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:38:17 +08:00
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.
This commit is contained in:
parent
b7beab5531
commit
dc1afeac89
|
@ -24,8 +24,8 @@ export default class MessageField extends BaseField {
|
||||||
{{#if this.displayPlaceholders}}
|
{{#if this.displayPlaceholders}}
|
||||||
<PlaceholdersList
|
<PlaceholdersList
|
||||||
@currentValue={{@field.metadata.value}}
|
@currentValue={{@field.metadata.value}}
|
||||||
@placeholders={{@placeholder}}
|
@placeholders={{@placeholders}}
|
||||||
@onCopy={{this.test}}
|
@onCopy={{this.mutValue}}
|
||||||
/>
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,4 +24,17 @@ module("Integration | Component | da-message-field", function (hooks) {
|
||||||
|
|
||||||
assert.strictEqual(this.field.metadata.value, "Hello World");
|
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`<AutomationField @automation={{this.automation}} @field={{this.field}} />`
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.dom(".placeholders-list").hasText("foo bar");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user