tests: Add missing awaits to change_user_name.js

Also increase the timeouts.
This commit is contained in:
Richard Hansen 2021-03-31 22:06:00 -04:00 committed by webzwo0i
parent bbf89dfcf9
commit d15ff9ce8d

View file

@ -7,27 +7,22 @@ describe('change username value', function () {
});
it('Remembers the user name after a refresh', async function () {
this.timeout(1500);
helper.toggleUserList();
helper.setUserName('😃');
helper.newPad({ // get a new pad, but don't clear the cookies
clearCookies: false,
cb() {
helper.toggleUserList();
expect(helper.usernameField().val()).to.be('😃');
},
});
this.timeout(10000);
await helper.toggleUserList();
await helper.setUserName('😃');
// get a new pad, but don't clear the cookies
await helper.aNewPad({clearCookies: false});
await helper.toggleUserList();
expect(helper.usernameField().val()).to.be('😃');
});
it('Own user name is shown when you enter a chat', async function () {
this.timeout(1500);
helper.toggleUserList();
helper.setUserName('😃');
this.timeout(10000);
await helper.toggleUserList();
await helper.setUserName('😃');
helper.showChat();
helper.sendChatMessage('O hi{enter}');
await helper.showChat();
await helper.sendChatMessage('O hi{enter}');
await helper.waitForPromise(() => {
// username:hours:minutes text