DEV: uses find() helper instead of this.$() in js tests (#7062)

This commit is contained in:
Joffrey JAFFEUX
2019-02-25 16:04:55 +01:00
committed by GitHub
parent c0dd171cf1
commit 5952a6c0ad
22 changed files with 332 additions and 318 deletions

View File

@ -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");
}
});