From ac68a26601ce5aa1b93d7373e5ea56356f2ec69e Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Tue, 20 Dec 2022 17:54:23 -0300 Subject: [PATCH] tests: solved change username to a new one only differing --- packages/accounts-password/password_tests.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/accounts-password/password_tests.js b/packages/accounts-password/password_tests.js index 8db410b340..9fc53d5fe6 100644 --- a/packages/accounts-password/password_tests.js +++ b/packages/accounts-password/password_tests.js @@ -1627,10 +1627,10 @@ if (Meteor.isServer) (() => { Accounts._options = options; }); - Tinytest.add("passwords - change username to a new one only differing " + - "in case", test => { + Tinytest.addAsync("passwords - change username to a new one only differing " + + "in case", async test => { const username = `${Random.id()}user`; - const userId = Accounts.createUser({ + const userId = await Accounts.createUser({ username: username.toUpperCase() }); @@ -1638,8 +1638,8 @@ if (Meteor.isServer) (() => { const newUsername = username.toLowerCase(); Accounts.setUsername(userId, newUsername); - - test.equal(Accounts._findUserByQuery({id: userId}).username, newUsername); + const u1 = await Accounts._findUserByQuery({id: userId}) + test.equal(u1.username, newUsername); }); // We should not be able to change the username to one that only