chat tests: Asyncify

pull/4750/head
Richard Hansen 2021-02-11 20:46:45 -05:00
parent 0fae34009d
commit 020df75677
1 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,7 @@ describe('chat-load-messages', function () {
this.timeout(60000); this.timeout(60000);
}); });
it('adds a lot of messages', function (done) { it('adds a lot of messages', async function () {
const chrome$ = helper.padChrome$; const chrome$ = helper.padChrome$;
const chatButton = chrome$('#chaticon'); const chatButton = chrome$('#chaticon');
chatButton.click(); chatButton.click();
@ -25,9 +25,8 @@ describe('chat-load-messages', function () {
chatInput.sendkeys(`msg${num}`); chatInput.sendkeys(`msg${num}`);
chatInput.sendkeys('{enter}'); chatInput.sendkeys('{enter}');
} }
helper.waitFor(() => chatText.children('p').length === messages, 60000).always(() => { await helper.waitForPromise(() => chatText.children('p').length === messages, 60000);
helper.newPad(done, padName); await new Promise((resolve) => helper.newPad(() => resolve(), padName));
});
}); });
it('checks initial message count', function (done) { it('checks initial message count', function (done) {