test: fix flaky `Team join` api tests (#32634)

pull/32624/head
Guilherme Gazzo 2 years ago committed by GitHub
parent ee43f2c57c
commit 6c17292ce8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      apps/meteor/tests/data/users.helper.js
  2. 7
      apps/meteor/tests/end-to-end/api/25-teams.js

@ -5,8 +5,8 @@ import { MongoClient } from 'mongodb';
import { URL_MONGODB } from '../e2e/config/constants';
export const createUser = (userData = {}) =>
new Promise((resolve) => {
const username = userData.username || `user.test.${Date.now()}`;
new Promise((resolve, reject) => {
const username = userData.username || `user.test.${Date.now()}.${Math.random()}`;
const email = userData.email || `${username}@rocket.chat`;
request
.post(api('users.create'))

@ -1602,9 +1602,10 @@ describe('[Teams]', () => {
let testUser2;
before(async () => {
const [testUserResult, testUser1Result] = await Promise.all([createUser(), createUser()]);
testUser1 = testUserResult;
testUser2 = testUser1Result;
const [testUser1Result, testUser2Result] = await Promise.all([createUser(), createUser()]);
testUser1 = testUser1Result;
testUser2 = testUser2Result;
});
beforeEach(async () => {

Loading…
Cancel
Save