FIX: Correctly render title-less poll widgets (#10837)

`RawHtml` does not like receiving undefined values as `html`.
This commit is contained in:
Jarek Radosz
2020-10-06 19:27:03 +02:00
committed by GitHub
parent f4c7c7bff3
commit 34c99da205
2 changed files with 15 additions and 2 deletions

View File

@@ -1,6 +1,9 @@
import I18n from "I18n";
import EmberObject from "@ember/object";
import { moduleForWidget, widgetTest } from "discourse/tests/helpers/widget-test";
import {
moduleForWidget,
widgetTest,
} from "discourse/tests/helpers/widget-test";
moduleForWidget("discourse-poll");
@@ -71,6 +74,14 @@ widgetTest("can vote", {
assert.equal(requests, 1);
assert.equal(find(".chosen").length, 1);
assert.equal(find(".chosen").text(), "100%yes");
assert.equal(find(".toggle-results").text(), "Show vote");
await click(".toggle-results");
assert.equal(
find("li[data-poll-option-id='1f972d1df351de3ce35a787c89faad29']").length,
1
);
assert.equal(find(".toggle-results").text(), "Show results");
},
});