DEV: Use async/await instead of andThen()

This commit is contained in:
Jarek Radosz 2020-05-10 20:41:21 +02:00
parent fe2d5da623
commit 6e3fe1abba

View File

@ -13,41 +13,35 @@ acceptance("Poll Builder - polls are disabled", {
}
});
test("regular user - sufficient trust level", assert => {
test("regular user - sufficient trust level", async assert => {
updateCurrentUser({ moderator: false, admin: false, trust_level: 3 });
displayPollBuilderButton();
await displayPollBuilderButton();
andThen(() => {
assert.ok(
!exists(".select-kit-row[title='Build Poll']"),
"it hides the builder button"
);
});
assert.ok(
!exists(".select-kit-row[title='Build Poll']"),
"it hides the builder button"
);
});
test("regular user - insufficient trust level", assert => {
test("regular user - insufficient trust level", async assert => {
updateCurrentUser({ moderator: false, admin: false, trust_level: 1 });
displayPollBuilderButton();
await displayPollBuilderButton();
andThen(() => {
assert.ok(
!exists(".select-kit-row[title='Build Poll']"),
"it hides the builder button"
);
});
assert.ok(
!exists(".select-kit-row[title='Build Poll']"),
"it hides the builder button"
);
});
test("staff", assert => {
test("staff", async assert => {
updateCurrentUser({ moderator: true });
displayPollBuilderButton();
await displayPollBuilderButton();
andThen(() => {
assert.ok(
!exists(".select-kit-row[title='Build Poll']"),
"it hides the builder button"
);
});
assert.ok(
!exists(".select-kit-row[title='Build Poll']"),
"it hides the builder button"
);
});