mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 09:22:42 +08:00
DEV: migrate components tests to async/await
This commit is contained in:
@ -26,25 +26,21 @@ componentTest("updating the content refreshes the list", {
|
||||
this.set("pinned", true);
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
this.get("subject")
|
||||
.header()
|
||||
.name(),
|
||||
"pinned"
|
||||
);
|
||||
});
|
||||
async test(assert) {
|
||||
assert.equal(
|
||||
this.get("subject")
|
||||
.header()
|
||||
.name(),
|
||||
"pinned"
|
||||
);
|
||||
|
||||
andThen(() => this.set("pinned", false));
|
||||
await this.set("pinned", false);
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
this.get("subject")
|
||||
.header()
|
||||
.name(),
|
||||
"unpinned"
|
||||
);
|
||||
});
|
||||
assert.equal(
|
||||
this.get("subject")
|
||||
.header()
|
||||
.name(),
|
||||
"unpinned"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user