diff --git a/src/tests/frontend/specs/change_user_name.js b/src/tests/frontend/specs/change_user_name.js index bfbf42d46..b146a1281 100644 --- a/src/tests/frontend/specs/change_user_name.js +++ b/src/tests/frontend/specs/change_user_name.js @@ -10,10 +10,12 @@ describe('change username value', function () { this.timeout(10000); await helper.toggleUserList(); await helper.setUserName('😃'); + // Give the server an opportunity to write the new name. + await new Promise((resolve) => setTimeout(resolve, 1000)); // get a new pad, but don't clear the cookies await helper.aNewPad({clearCookies: false}); await helper.toggleUserList(); - expect(helper.usernameField().val()).to.be('😃'); + await helper.waitForPromise(() => helper.usernameField().val() === '😃'); }); it('Own user name is shown when you enter a chat', async function () {