Merge branch 'hotfix/21.56.9' into master
[gitter.git] / modules / test-utils / lib / fixture-utils.js
blob71114b80e63c0b837130532d4484530a1d5e9a96
1 'use strict';
3 var counter = 0;
4 var seed = Date.now();
6 function generateEmail() {
7 return 'testuser' + ++counter + seed + '@troupetest.local';
10 function generateName() {
11 return `Test ${++counter} ${seed}`;
14 function generateUri(roomType) {
15 if (roomType === 'REPO') {
16 return `_test_${++counter}${seed}/_repo_${++counter}${Date.now()}`;
19 return '_test_' + ++counter + seed;
22 function generateUsername() {
23 return `_testuser_${++counter}${seed}`;
26 function generateGithubId() {
27 return ++counter + seed;
30 function generateGroupUri(optionalName) {
31 return `_${optionalName || 'group'}-${++counter}${Date.now()}`;
34 module.exports = {
35 generateEmail: generateEmail,
36 generateName: generateName,
37 generateUri: generateUri,
38 generateUsername: generateUsername,
39 generateGithubId: generateGithubId,
40 generateGroupUri: generateGroupUri