DEV: Replace equal() with strictEqual() (#14827)

This commit is contained in:
Jarek Radosz
2021-11-08 10:26:28 +01:00
committed by GitHub
parent 016aa06229
commit d162229758
263 changed files with 2827 additions and 2363 deletions

View File

@@ -23,14 +23,14 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
pollOptions: [{ value: "a" }],
});
assert.equal(controller.isMultiple, true, "it should be true");
assert.strictEqual(controller.isMultiple, true, "it should be true");
controller.setProperties({
pollType: "random",
pollOptions: [{ value: "b" }],
});
assert.equal(controller.isMultiple, false, "it should be false");
assert.strictEqual(controller.isMultiple, false, "it should be false");
});
test("isNumber", function (assert) {
@@ -38,11 +38,11 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
controller.set("pollType", REGULAR_POLL_TYPE);
assert.equal(controller.isNumber, false, "it should be false");
assert.strictEqual(controller.isNumber, false, "it should be false");
controller.set("pollType", NUMBER_POLL_TYPE);
assert.equal(controller.isNumber, true, "it should be true");
assert.strictEqual(controller.isNumber, true, "it should be true");
});
test("pollOptionsCount", function (assert) {
@@ -50,47 +50,47 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
controller.set("pollOptions", [{ value: "1" }, { value: "2" }]);
assert.equal(controller.pollOptionsCount, 2, "it should equal 2");
assert.strictEqual(controller.pollOptionsCount, 2, "it should equal 2");
controller.set("pollOptions", []);
assert.equal(controller.pollOptionsCount, 0, "it should equal 0");
assert.strictEqual(controller.pollOptionsCount, 0, "it should equal 0");
});
test("disableInsert", function (assert) {
const controller = setupController(this);
controller.siteSettings.poll_maximum_options = 20;
assert.equal(controller.disableInsert, true, "it should be true");
assert.strictEqual(controller.disableInsert, true, "it should be true");
controller.set("pollOptions", [{ value: "a" }, { value: "b" }]);
assert.equal(controller.disableInsert, false, "it should be false");
assert.strictEqual(controller.disableInsert, false, "it should be false");
controller.set("pollType", NUMBER_POLL_TYPE);
assert.equal(controller.disableInsert, false, "it should be false");
assert.strictEqual(controller.disableInsert, false, "it should be false");
controller.setProperties({
pollType: REGULAR_POLL_TYPE,
pollOptions: [{ value: "a" }, { value: "b" }, { value: "c" }],
});
assert.equal(controller.disableInsert, false, "it should be false");
assert.strictEqual(controller.disableInsert, false, "it should be false");
controller.setProperties({
pollType: REGULAR_POLL_TYPE,
pollOptions: [],
});
assert.equal(controller.disableInsert, true, "it should be true");
assert.strictEqual(controller.disableInsert, true, "it should be true");
controller.setProperties({
pollType: REGULAR_POLL_TYPE,
pollOptions: [{ value: "w" }],
});
assert.equal(controller.disableInsert, false, "it should be false");
assert.strictEqual(controller.disableInsert, false, "it should be false");
});
test("number pollOutput", async function (assert) {
@@ -103,7 +103,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
});
await settled();
assert.equal(
assert.strictEqual(
controller.pollOutput,
"[poll type=number results=always min=1 max=20 step=1]\n[/poll]\n",
"it should return the right output"
@@ -111,7 +111,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
controller.set("pollStep", 2);
await settled();
assert.equal(
assert.strictEqual(
controller.pollOutput,
"[poll type=number results=always min=1 max=20 step=2]\n[/poll]\n",
"it should return the right output"
@@ -119,7 +119,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
controller.set("publicPoll", true);
assert.equal(
assert.strictEqual(
controller.pollOutput,
"[poll type=number results=always min=1 max=20 step=2 public=true]\n[/poll]\n",
"it should return the right output"
@@ -127,7 +127,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
controller.set("pollStep", 0);
assert.equal(
assert.strictEqual(
controller.pollOutput,
"[poll type=number results=always min=1 max=20 step=1 public=true]\n[/poll]\n",
"it should return the right output"
@@ -143,7 +143,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
pollType: REGULAR_POLL_TYPE,
});
assert.equal(
assert.strictEqual(
controller.pollOutput,
"[poll type=regular results=always chartType=bar]\n* 1\n* 2\n[/poll]\n",
"it should return the right output"
@@ -151,7 +151,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
controller.set("publicPoll", "true");
assert.equal(
assert.strictEqual(
controller.pollOutput,
"[poll type=regular results=always public=true chartType=bar]\n* 1\n* 2\n[/poll]\n",
"it should return the right output"
@@ -159,7 +159,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
controller.set("pollGroups", "test");
assert.equal(
assert.strictEqual(
controller.get("pollOutput"),
"[poll type=regular results=always public=true chartType=bar groups=test]\n* 1\n* 2\n[/poll]\n",
"it should return the right output"
@@ -176,7 +176,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
pollOptions: [{ value: "1" }, { value: "2" }],
});
assert.equal(
assert.strictEqual(
controller.pollOutput,
"[poll type=multiple results=always min=1 max=2 chartType=bar]\n* 1\n* 2\n[/poll]\n",
"it should return the right output"
@@ -184,7 +184,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
controller.set("publicPoll", "true");
assert.equal(
assert.strictEqual(
controller.pollOutput,
"[poll type=multiple results=always min=1 max=2 public=true chartType=bar]\n* 1\n* 2\n[/poll]\n",
"it should return the right output"
@@ -204,7 +204,7 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
test("poll result is always by default", function (assert) {
const controller = setupController(this);
assert.equal(controller.pollResult, "always");
assert.strictEqual(controller.pollResult, "always");
});
test("staff_only option is present for staff", async function (assert) {