mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
FIX: Flaky JS test due to not waiting for promises
This commit is contained in:
parent
f2e14a3946
commit
284b9e9911
@ -56,11 +56,11 @@ QUnit.test("updateFromPost", assert => {
|
||||
assert.equal(post.get("raw"), "different raw", "raw field updated");
|
||||
});
|
||||
|
||||
QUnit.test("destroy by staff", assert => {
|
||||
var user = User.create({ username: "staff", moderator: true }),
|
||||
post = buildPost({ user: user });
|
||||
QUnit.test("destroy by staff", async assert => {
|
||||
let user = User.create({ username: "staff", moderator: true });
|
||||
let post = buildPost({ user: user });
|
||||
|
||||
post.destroy(user);
|
||||
await post.destroy(user);
|
||||
|
||||
assert.present(post.get("deleted_at"), "it has a `deleted_at` field.");
|
||||
assert.equal(
|
||||
@ -69,7 +69,8 @@ QUnit.test("destroy by staff", assert => {
|
||||
"it has the user in the `deleted_by` field"
|
||||
);
|
||||
|
||||
post.recover();
|
||||
await post.recover();
|
||||
|
||||
assert.blank(
|
||||
post.get("deleted_at"),
|
||||
"it clears `deleted_at` when recovering"
|
||||
|
Loading…
Reference in New Issue
Block a user