mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: uses find() helper instead of this.$() in js tests (#7062)
This commit is contained in:
@ -19,8 +19,8 @@ widgetTest("options in descending order", {
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.equal(this.$(".option .percentage:eq(0)").text(), "56%");
|
||||
assert.equal(this.$(".option .percentage:eq(1)").text(), "44%");
|
||||
assert.equal(find(".option .percentage:eq(0)").text(), "56%");
|
||||
assert.equal(find(".option .percentage:eq(1)").text(), "44%");
|
||||
}
|
||||
});
|
||||
|
||||
@ -38,8 +38,8 @@ widgetTest("options in ascending order", {
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.equal(this.$(".option .percentage:eq(0)").text(), "56%");
|
||||
assert.equal(this.$(".option .percentage:eq(1)").text(), "44%");
|
||||
assert.equal(find(".option .percentage:eq(0)").text(), "56%");
|
||||
assert.equal(find(".option .percentage:eq(1)").text(), "44%");
|
||||
}
|
||||
});
|
||||
|
||||
@ -65,12 +65,12 @@ widgetTest("multiple options in descending order", {
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.equal(this.$(".option .percentage:eq(0)").text(), "41%");
|
||||
assert.equal(this.$(".option .percentage:eq(1)").text(), "33%");
|
||||
assert.equal(this.$(".option .percentage:eq(2)").text(), "16%");
|
||||
assert.equal(this.$(".option .percentage:eq(3)").text(), "8%");
|
||||
assert.equal(this.$(".option span:nth-child(2):eq(3)").text(), "a");
|
||||
assert.equal(this.$(".option .percentage:eq(4)").text(), "8%");
|
||||
assert.equal(this.$(".option span:nth-child(2):eq(4)").text(), "b");
|
||||
assert.equal(find(".option .percentage:eq(0)").text(), "41%");
|
||||
assert.equal(find(".option .percentage:eq(1)").text(), "33%");
|
||||
assert.equal(find(".option .percentage:eq(2)").text(), "16%");
|
||||
assert.equal(find(".option .percentage:eq(3)").text(), "8%");
|
||||
assert.equal(find(".option span:nth-child(2):eq(3)").text(), "a");
|
||||
assert.equal(find(".option .percentage:eq(4)").text(), "8%");
|
||||
assert.equal(find(".option span:nth-child(2):eq(4)").text(), "b");
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user