UX: Improve poll builder UI (#12549)

* Improve poll validation

* Redesign poll builder

* Group all advanced settings under a new section
This commit is contained in:
Bianca Nenciu
2021-04-12 19:48:01 +03:00
committed by GitHub
parent 7d1cef71ff
commit 2081b6e5c9
9 changed files with 544 additions and 622 deletions

View File

@ -1,12 +1,10 @@
import {
acceptance,
exists,
queryAll,
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
import { displayPollBuilderButton } from "discourse/plugins/poll/helpers/display-poll-builder-button";
import selectKit from "discourse/tests/helpers/select-kit-helper";
acceptance("Poll Builder - polls are enabled", function (needs) {
needs.user();
@ -48,22 +46,4 @@ acceptance("Poll Builder - polls are enabled", function (needs) {
"it shows the builder button"
);
});
test("poll preview", async function (assert) {
await displayPollBuilderButton();
const popupMenu = selectKit(".toolbar-popup-menu-options");
await popupMenu.selectRowByValue("showPollBuilder");
await fillIn(".poll-textarea textarea", "First option\nSecond option");
assert.equal(
queryAll(".d-editor-preview li:first-child").text(),
"First option"
);
assert.equal(
queryAll(".d-editor-preview li:last-child").text(),
"Second option"
);
});
});