DEV: adds a caret option to widget dropdown (#9588)

DEV: adds a caret option to widget dropdown (#9588)

diff --git a/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js b/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js
index e882588..c063296 100644
--- a/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js
+++ b/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js
@@ -80,6 +80,9 @@ export const WidgetDropdownHeaderClass = {
     <span class="label">
       {{transformed.label}}
     </span>
+    {{#if attrs.caret}}
+      {{d-icon "caret-down"}}
+    {{/if}}
   `
 };
 
@@ -218,6 +221,7 @@ export const WidgetDropdownClass = {
           label=attrs.label
           translatedLabel=attrs.translatedLabel
           class=this.transformed.options.headerClass
+          caret=this.transformed.options.caret
         )
       }}
 
diff --git a/test/javascripts/widgets/widget-dropdown-test.js b/test/javascripts/widgets/widget-dropdown-test.js
index 46625d7..2bc7f94 100644
--- a/test/javascripts/widgets/widget-dropdown-test.js
+++ b/test/javascripts/widgets/widget-dropdown-test.js
@@ -302,3 +302,18 @@ widgetTest("bodyClass option", {
     assert.ok(body().classList.contains("and-yet-small"));
   }
 });
+
+widgetTest("caret option", {
+  template: TEMPLATE,
+
+  beforeEach() {
+    this.setProperties(DEFAULT_CONTENT);
+    this.set("options", { caret: true });
+  },
+
+  test(assert) {
+    assert.ok(
+      exists("#my-dropdown .widget-dropdown-header .d-icon-caret-down")
+    );
+  }
+});

GitHub sha: a1b91505

This commit appears in #9588 which was merged by jjaffeux.