DEV: migrate components tests to async/await

This commit is contained in:
Maja Komel
2018-07-24 20:12:09 +02:00
parent c0992a4d31
commit d16a2c776a
10 changed files with 619 additions and 615 deletions

View File

@ -21,46 +21,42 @@ componentTest("default", {
this.set("topic", buildTopic());
},
test(assert) {
this.get("subject").expand();
async test(assert) {
await this.get("subject").expandAwait();
andThen(() => {
assert.equal(
this.get("subject")
.header()
.title(),
"Topic Controls"
);
assert.equal(
this.get("subject")
.header()
.value(),
null
);
assert.equal(
this.get("subject")
.rowByIndex(0)
.name(),
"Bookmark"
);
assert.equal(
this.get("subject")
.rowByIndex(1)
.name(),
"Share"
);
assert.notOk(
this.get("subject")
.selectedRow()
.exists(),
"it doesn’t preselect first row"
);
});
assert.equal(
this.get("subject")
.header()
.title(),
"Topic Controls"
);
assert.equal(
this.get("subject")
.header()
.value(),
null
);
assert.equal(
this.get("subject")
.rowByIndex(0)
.name(),
"Bookmark"
);
assert.equal(
this.get("subject")
.rowByIndex(1)
.name(),
"Share"
);
assert.notOk(
this.get("subject")
.selectedRow()
.exists(),
"it doesn’t preselect first row"
);
this.get("subject").selectRowByValue("share");
await this.get("subject").selectRowByValueAwait("share");
andThen(() => {
assert.equal(this.get("value"), null, "it resets the value");
});
assert.equal(this.get("value"), null, "it resets the value");
}
});