DEV: Remove most of jQuery usage from tests (#17474)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
acceptance,
|
||||
count,
|
||||
query,
|
||||
queryAll,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
@@ -25,7 +25,7 @@ acceptance("Rendering polls with pie charts", function (needs) {
|
||||
);
|
||||
|
||||
assert.strictEqual(
|
||||
queryAll(".info-number", poll)[1].innerHTML,
|
||||
poll.querySelectorAll(".info-number")[1].innerHTML,
|
||||
"5",
|
||||
"it should display the right number of votes"
|
||||
);
|
||||
@@ -37,7 +37,7 @@ acceptance("Rendering polls with pie charts", function (needs) {
|
||||
);
|
||||
|
||||
assert.strictEqual(
|
||||
queryAll(".poll-results-chart", poll).length,
|
||||
count(".poll-results-chart", poll),
|
||||
1,
|
||||
"Renders the chart div instead of bar container"
|
||||
);
|
||||
|
||||
@@ -196,8 +196,9 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
|
||||
controller.currentUser = { staff: false };
|
||||
controller.notifyPropertyChange("pollResults");
|
||||
|
||||
assert.ok(
|
||||
controller.pollResults.filterBy("value", "staff_only").length === 0,
|
||||
assert.strictEqual(
|
||||
controller.pollResults.filterBy("value", "staff_only").length,
|
||||
0,
|
||||
"staff_only is not present"
|
||||
);
|
||||
});
|
||||
@@ -212,8 +213,9 @@ discourseModule("Unit | Controller | poll-ui-builder", function () {
|
||||
controller.currentUser = { staff: true };
|
||||
controller.notifyPropertyChange("pollResults");
|
||||
|
||||
assert.ok(
|
||||
controller.pollResults.filterBy("value", "staff_only").length === 1,
|
||||
assert.strictEqual(
|
||||
controller.pollResults.filterBy("value", "staff_only").length,
|
||||
1,
|
||||
"staff_only is present"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user