FIX: Set default value for poll result field (#10044)

FIX: Set default value for poll result field (#10044)

diff --git a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6
index 0eca3fa..0dc7325 100644
--- a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6
+++ b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6
@@ -350,6 +350,7 @@ export default Controller.extend({
       pollStep: 1,
       autoClose: false,
       chartType: BAR_CHART_TYPE,
+      pollResult: this.alwaysPollResult,
       pollGroups: null,
       date: moment()
         .add(1, "day")
diff --git a/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 b/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6
index e8ec029..3eee6bb 100644
--- a/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6
+++ b/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6
@@ -320,6 +320,11 @@ test("staff_only option is not present for non-staff", function(assert) {
   );
 });
 
+test("poll result is always by default", function(assert) {
+  const controller = this.subject();
+  assert.equal(controller.pollResult, "always");
+});
+
 test("staff_only option is present for staff", function(assert) {
   const controller = this.subject();
   controller.currentUser = { staff: true };

GitHub sha: 40de5352

1 Like