From 020df7567731fedfdd837ff9223ec57a6496fdae Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 11 Feb 2021 20:46:45 -0500 Subject: [PATCH] chat tests: Asyncify --- src/tests/frontend/specs/chat_load_messages.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tests/frontend/specs/chat_load_messages.js b/src/tests/frontend/specs/chat_load_messages.js index 6015b894f..8d25f13bc 100644 --- a/src/tests/frontend/specs/chat_load_messages.js +++ b/src/tests/frontend/specs/chat_load_messages.js @@ -8,7 +8,7 @@ describe('chat-load-messages', function () { this.timeout(60000); }); - it('adds a lot of messages', function (done) { + it('adds a lot of messages', async function () { const chrome$ = helper.padChrome$; const chatButton = chrome$('#chaticon'); chatButton.click(); @@ -25,9 +25,8 @@ describe('chat-load-messages', function () { chatInput.sendkeys(`msg${num}`); chatInput.sendkeys('{enter}'); } - helper.waitFor(() => chatText.children('p').length === messages, 60000).always(() => { - helper.newPad(done, padName); - }); + await helper.waitForPromise(() => chatText.children('p').length === messages, 60000); + await new Promise((resolve) => helper.newPad(() => resolve(), padName)); }); it('checks initial message count', function (done) {