diff --git a/app/assets/javascripts/discourse/app/form-kit/components/fk/control-wrapper.gjs b/app/assets/javascripts/discourse/app/form-kit/components/fk/control-wrapper.gjs index 7207f46bf3c..58c33e26a40 100644 --- a/app/assets/javascripts/discourse/app/form-kit/components/fk/control-wrapper.gjs +++ b/app/assets/javascripts/discourse/app/form-kit/components/fk/control-wrapper.gjs @@ -94,7 +94,7 @@ export default class FKControlWrapper extends Component { { field.doesNotExist(message); }, + hasSubtitle: (value, message) => { + field.hasSubtitle(value, message); + }, + hasDescription: (value, message) => { + field.hasDescription(value, message); + }, exists: (message) => { field.exists(message); }, diff --git a/app/assets/javascripts/discourse/tests/integration/components/form-kit/field-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/form-kit/field-test.gjs index d84b5f26c49..414a3ab7dd1 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/form-kit/field-test.gjs +++ b/app/assets/javascripts/discourse/tests/integration/components/form-kit/field-test.gjs @@ -35,6 +35,30 @@ module("Integration | Component | FormKit | Field", function (hooks) { assert.dom(".form-kit__row .form-kit__col.--col-8").hasText("Test"); }); + test("@subtitle", async function (assert) { + await render(); + + assert.form().field("foo").hasSubtitle("foo foo"); + }); + + test("@description", async function (assert) { + await render(); + + assert.form().field("foo").hasDescription("foo foo"); + }); + test("invalid @name", async function (assert) { setupOnerror((error) => { assert.deepEqual(error.message, "@name can't include `.` or `-`."); diff --git a/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/05-forms.hbs b/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/05-forms.hbs index 5e101e50605..500051d4d55 100644 --- a/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/05-forms.hbs +++ b/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/05-forms.hbs @@ -16,7 +16,13 @@ - +