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
@@ -76,7 +76,7 @@ acceptance("Poll breakdown", function (needs) {
assert.ok(exists(".poll-breakdown-total-votes"), "displays the vote count");
assert.equal(
assert.strictEqual(
count(".poll-breakdown-chart-container"),
2,
"renders a chart for each of the groups in group_results response"
@@ -92,7 +92,7 @@ acceptance("Poll breakdown", function (needs) {
await visit("/t/-/topic_with_pie_chart_poll");
await click(".poll-show-breakdown");
assert.equal(
assert.strictEqual(
query(".poll-breakdown-option-count").textContent.trim(),
"40.0%",
"displays the correct vote percentage"
@@ -100,7 +100,7 @@ acceptance("Poll breakdown", function (needs) {
await click(".modal-tabs .count");
assert.equal(
assert.strictEqual(
query(".poll-breakdown-option-count").textContent.trim(),
"2",
"displays the correct vote count"
@@ -108,7 +108,7 @@ acceptance("Poll breakdown", function (needs) {
await click(".modal-tabs .percentage");
assert.equal(
assert.strictEqual(
query(".poll-breakdown-option-count").textContent.trim(),
"40.0%",
"displays the percentage again"
@@ -18,25 +18,25 @@ acceptance("Rendering polls with pie charts", function (needs) {
const poll = query(".poll");
assert.equal(
assert.strictEqual(
query(".info-number", poll).innerHTML,
"2",
"it should display the right number of voters"
);
assert.equal(
assert.strictEqual(
queryAll(".info-number", poll)[1].innerHTML,
"5",
"it should display the right number of votes"
);
assert.equal(
assert.strictEqual(
poll.classList.contains("pie"),
true,
"pie class is present on poll div"
);
assert.equal(
assert.strictEqual(
queryAll(".poll-results-chart", poll).length,
1,
"Renders the chart div instead of bar container"
@@ -432,7 +432,7 @@ acceptance("Poll quote", function (needs) {
test("renders and extends", async function (assert) {
await visit("/t/-/topic_with_two_quoted_polls");
await click(".quote-controls");
assert.equal(count(".poll"), 2, "polls are rendered");
assert.equal(count(".poll-buttons"), 2, "polls are extended");
assert.strictEqual(count(".poll"), 2, "polls are rendered");
assert.strictEqual(count(".poll-buttons"), 2, "polls are extended");
});
});
@@ -567,11 +567,11 @@ acceptance("Poll results", function (needs) {
test("can load more voters", async function (assert) {
await visit("/t/-/load-more-poll-voters");
assert.equal(
assert.strictEqual(
find(".poll-container .results li:nth-child(1) .poll-voters li").length,
1
);
assert.equal(
assert.strictEqual(
find(".poll-container .results li:nth-child(2) .poll-voters li").length,
0
);
@@ -626,11 +626,11 @@ acceptance("Poll results", function (needs) {
});
await visit("/t/-/load-more-poll-voters");
assert.equal(
assert.strictEqual(
find(".poll-container .results li:nth-child(1) .poll-voters li").length,
1
);
assert.equal(
assert.strictEqual(
find(".poll-container .results li:nth-child(2) .poll-voters li").length,
1
);
@@ -638,11 +638,11 @@ acceptance("Poll results", function (needs) {
await click(".poll-voters-toggle-expand a");
await visit("/t/-/load-more-poll-voters");
assert.equal(
assert.strictEqual(
find(".poll-container .results li:nth-child(1) .poll-voters li").length,
2
);
assert.equal(
assert.strictEqual(
find(".poll-container .results li:nth-child(2) .poll-voters li").length,
0
);
@@ -652,13 +652,13 @@ acceptance("Poll results", function (needs) {
await visit("/t/-/load-more-poll-voters");
await click(".toggle-results");
assert.equal(count(".poll-container .d-icon-circle"), 1);
assert.equal(count(".poll-container .d-icon-far-circle"), 1);
assert.strictEqual(count(".poll-container .d-icon-circle"), 1);
assert.strictEqual(count(".poll-container .d-icon-far-circle"), 1);
await click(".remove-vote");
assert.equal(count(".poll-container .d-icon-circle"), 0);
assert.equal(count(".poll-container .d-icon-far-circle"), 2);
assert.strictEqual(count(".poll-container .d-icon-circle"), 0);
assert.strictEqual(count(".poll-container .d-icon-far-circle"), 2);
});
});
@@ -46,15 +46,15 @@ acceptance("Rendering polls with bar charts - desktop", function (needs) {
const polls = queryAll(".poll");
assert.equal(polls.length, 2, "it should render the polls correctly");
assert.strictEqual(polls.length, 2, "it should render the polls correctly");
assert.equal(
assert.strictEqual(
queryAll(".info-number", polls[0]).text(),
"2",
"it should display the right number of votes"
);
assert.equal(
assert.strictEqual(
queryAll(".info-number", polls[1]).text(),
"3",
"it should display the right number of votes"
@@ -65,11 +65,11 @@ acceptance("Rendering polls with bar charts - desktop", function (needs) {
await visit("/t/-/14");
const polls = queryAll(".poll");
assert.equal(polls.length, 1, "it should render the poll correctly");
assert.strictEqual(polls.length, 1, "it should render the poll correctly");
await click("button.toggle-results");
assert.equal(
assert.strictEqual(
queryAll(".poll-voters:nth-of-type(1) li").length,
25,
"it should display the right number of voters"
@@ -77,7 +77,7 @@ acceptance("Rendering polls with bar charts - desktop", function (needs) {
await click(".poll-voters-toggle-expand:nth-of-type(1) a");
assert.equal(
assert.strictEqual(
queryAll(".poll-voters:nth-of-type(1) li").length,
26,
"it should display the right number of voters"
@@ -88,11 +88,11 @@ acceptance("Rendering polls with bar charts - desktop", function (needs) {
await visit("/t/-/13");
const polls = queryAll(".poll");
assert.equal(polls.length, 1, "it should render the poll correctly");
assert.strictEqual(polls.length, 1, "it should render the poll correctly");
await click("button.toggle-results");
assert.equal(
assert.strictEqual(
queryAll(".poll-voters:nth-of-type(1) li").length,
25,
"it should display the right number of voters"
@@ -105,7 +105,7 @@ acceptance("Rendering polls with bar charts - desktop", function (needs) {
await click(".poll-voters-toggle-expand:nth-of-type(1) a");
assert.equal(
assert.strictEqual(
queryAll(".poll-voters:nth-of-type(1) li").length,
30,
"it should display the right number of voters"
@@ -27,11 +27,11 @@ acceptance("Rendering polls with bar charts - mobile", function (needs) {
await visit("/t/-/13");
const polls = queryAll(".poll");
assert.equal(polls.length, 1, "it should render the poll correctly");
assert.strictEqual(polls.length, 1, "it should render the poll correctly");
await click("button.toggle-results");
assert.equal(
assert.strictEqual(
queryAll(".poll-voters:nth-of-type(1) li").length,
25,
"it should display the right number of voters"
@@ -44,7 +44,7 @@ acceptance("Rendering polls with bar charts - mobile", function (needs) {
await click(".poll-voters-toggle-expand:nth-of-type(1) a");
assert.equal(
assert.strictEqual(
queryAll(".poll-voters:nth-of-type(1) li").length,
35,
"it should display the right number of voters"