mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat: add more profile e2e tests (#54706)
This commit is contained in:
@@ -2,7 +2,12 @@ const path = require('path');
|
||||
const debug = require('debug');
|
||||
require('dotenv').config({ path: path.resolve(__dirname, '../../../.env') });
|
||||
const { MongoClient, ObjectId } = require('mongodb');
|
||||
const { demoUser, blankUser, fullyCertifiedUser } = require('./user-data');
|
||||
const {
|
||||
demoUser,
|
||||
blankUser,
|
||||
publicUser,
|
||||
fullyCertifiedUser
|
||||
} = require('./user-data');
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
@@ -102,7 +107,8 @@ const user = db.collection('user');
|
||||
const userIds = [
|
||||
new ObjectId('5fa2db00a25c1c1fa49ce067'),
|
||||
new ObjectId('5bd30e0f1caf6ac3ddddddb5'),
|
||||
new ObjectId('5bd30e0f1caf6ac3ddddddb9')
|
||||
new ObjectId('5bd30e0f1caf6ac3ddddddb9'),
|
||||
new ObjectId('663b839b24a8b29f57728b13')
|
||||
];
|
||||
|
||||
const dropUserTokens = async function () {
|
||||
@@ -130,9 +136,11 @@ const run = async () => {
|
||||
if (args.includes('certified-user')) {
|
||||
await user.insertOne(fullyCertifiedUser);
|
||||
await user.insertOne(blankUser);
|
||||
await user.insertOne(publicUser);
|
||||
} else {
|
||||
await user.insertOne(demoUser);
|
||||
await user.insertOne(blankUser);
|
||||
await user.insertOne(publicUser);
|
||||
}
|
||||
log('local auth user seed complete');
|
||||
};
|
||||
|
||||
@@ -63,6 +63,67 @@ module.exports = {
|
||||
externalId: '',
|
||||
unsubscribeId: 'ecJxUi7OM49f24hTpauP8'
|
||||
},
|
||||
publicUser: {
|
||||
_id: new ObjectId('663b839b24a8b29f57728b13'),
|
||||
email: 'bar@bars.com',
|
||||
emailVerified: true,
|
||||
progressTimestamps: [],
|
||||
isBanned: false,
|
||||
isCheater: false,
|
||||
username: 'publicuser',
|
||||
about: '',
|
||||
name: 'Public User',
|
||||
location: '',
|
||||
picture: '',
|
||||
acceptedPrivacyTerms: true,
|
||||
sendQuincyEmail: false,
|
||||
currentChallengeId: '',
|
||||
isHonest: false,
|
||||
isFrontEndCert: false,
|
||||
isDataVisCert: false,
|
||||
isBackEndCert: false,
|
||||
isFullStackCert: false,
|
||||
isRespWebDesignCert: false,
|
||||
is2018DataVisCert: false,
|
||||
isFrontEndLibsCert: false,
|
||||
isJsAlgoDataStructCert: false,
|
||||
isApisMicroservicesCert: false,
|
||||
isInfosecQaCert: false,
|
||||
isQaCertV7: false,
|
||||
isInfosecCertV7: false,
|
||||
is2018FullStackCert: false,
|
||||
isSciCompPyCertV7: false,
|
||||
isDataAnalysisPyCertV7: false,
|
||||
isMachineLearningPyCertV7: false,
|
||||
isRelationalDatabaseCertV8: false,
|
||||
isCollegeAlgebraPyCertV8: false,
|
||||
isFoundationalCSharpCertV8: false,
|
||||
completedChallenges: [],
|
||||
portfolio: [],
|
||||
yearsTopContributor: [],
|
||||
rand: 0.6126749173148205,
|
||||
theme: 'default',
|
||||
profileUI: {
|
||||
isLocked: false,
|
||||
showAbout: true,
|
||||
showCerts: true,
|
||||
showDonation: true,
|
||||
showHeatMap: true,
|
||||
showLocation: true,
|
||||
showName: true,
|
||||
showPoints: true,
|
||||
showPortfolio: true,
|
||||
showTimeLine: true
|
||||
},
|
||||
badges: {
|
||||
coreTeam: []
|
||||
},
|
||||
isDonating: false,
|
||||
emailAuthLinkTTL: null,
|
||||
emailVerifyTTL: null,
|
||||
externalId: '',
|
||||
unsubscribeId: 'ecJxUi7OM49f24hTpauP8'
|
||||
},
|
||||
demoUser: {
|
||||
_id: new ObjectId('5bd30e0f1caf6ac3ddddddb5'),
|
||||
email: 'foo@bar.com',
|
||||
|
||||
Reference in New Issue
Block a user