mirror of
https://github.com/discourse/discourse.git
synced 2025-03-03 09:49:42 +00:00
FIX: Fix poll builder qunit tests
This commit is contained in:
parent
40ab2e5667
commit
3eb125c39b
@ -59,6 +59,14 @@ test("showMinMax", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
equal(controller.get("showMinMax"), true, "it should be true");
|
equal(controller.get("showMinMax"), true, "it should be true");
|
||||||
|
|
||||||
|
controller.setProperties({
|
||||||
|
isNumber: false,
|
||||||
|
isMultiple: false,
|
||||||
|
isRegular: true
|
||||||
|
});
|
||||||
|
|
||||||
|
equal(controller.get("showMinMax"), false, "it should be false");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("pollOptionsCount", function() {
|
test("pollOptionsCount", function() {
|
||||||
@ -147,6 +155,14 @@ test("disableInsert", function() {
|
|||||||
const controller = this.subject();
|
const controller = this.subject();
|
||||||
controller.siteSettings = Discourse.SiteSettings;
|
controller.siteSettings = Discourse.SiteSettings;
|
||||||
|
|
||||||
|
controller.setProperties({ isRegular: true });
|
||||||
|
|
||||||
|
equal(controller.get("disableInsert"), true, "it should be true");
|
||||||
|
|
||||||
|
controller.setProperties({ isRegular: true, pollOptionsCount: 2 });
|
||||||
|
|
||||||
|
equal(controller.get("disableInsert"), false, "it should be false");
|
||||||
|
|
||||||
controller.setProperties({ isNumber: true });
|
controller.setProperties({ isNumber: true });
|
||||||
|
|
||||||
equal(controller.get("disableInsert"), false, "it should be false");
|
equal(controller.get("disableInsert"), false, "it should be false");
|
||||||
@ -188,12 +204,16 @@ test("regular pollOutput", function() {
|
|||||||
controller.siteSettings.poll_maximum_options = 20;
|
controller.siteSettings.poll_maximum_options = 20;
|
||||||
|
|
||||||
controller.set("pollOptions", "1\n2");
|
controller.set("pollOptions", "1\n2");
|
||||||
|
controller.setProperties({
|
||||||
|
pollOptions: "1\n2",
|
||||||
|
pollType: controller.get("regularPollType")
|
||||||
|
});
|
||||||
|
|
||||||
equal(controller.get("pollOutput"), "[poll]\n* 1\n* 2\n[/poll]", "it should return the right output");
|
equal(controller.get("pollOutput"), "[poll type=regular]\n* 1\n* 2\n[/poll]", "it should return the right output");
|
||||||
|
|
||||||
controller.set("publicPoll", "true");
|
controller.set("publicPoll", "true");
|
||||||
|
|
||||||
equal(controller.get("pollOutput"), "[poll public=true]\n* 1\n* 2\n[/poll]", "it should return the right output");
|
equal(controller.get("pollOutput"), "[poll type=regular public=true]\n* 1\n* 2\n[/poll]", "it should return the right output");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user