mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 06:51:27 +08:00
FEATURE: Add a preview to the poll builder (#7988)
* FEATURE: Add a preview to the poll builder * Use selectKit helper in the poll preview test * Extract the mobile-specific poll builder form CSS
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import selectKit from "helpers/select-kit-helper";
|
||||
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
|
||||
import { displayPollBuilderButton } from "discourse/plugins/poll/helpers/display-poll-builder-button";
|
||||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
@ -51,3 +52,15 @@ test("staff - with insufficient trust level", assert => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test("poll preview", async assert => {
|
||||
displayPollBuilderButton();
|
||||
const popupMenu = selectKit(".toolbar-popup-menu-options");
|
||||
await popupMenu.expand();
|
||||
await popupMenu.selectRowByValue("showPollBuilder");
|
||||
|
||||
await fillIn(".poll-textarea textarea", "First option\nSecond option");
|
||||
|
||||
assert.equal(find(".d-editor-preview li:first-child").text(), "First option");
|
||||
assert.equal(find(".d-editor-preview li:last-child").text(), "Second option");
|
||||
});
|
||||
|
Reference in New Issue
Block a user