diff --git a/tests/Seeds.ts b/tests/Seeds.ts index 8633deef..74ba5023 100644 --- a/tests/Seeds.ts +++ b/tests/Seeds.ts @@ -1,6 +1,6 @@ import * as moment from 'moment'; import { UserAccessType } from '../types'; -import { DatabaseConnection, EventFactory, MerchFactory, PortalState, UserFactory } from './data'; +import { DatabaseConnection, EventFactory, MerchFactory, PortalState, UserFactory, ResumeFactory } from './data'; function getGraduationYear(n: number) { return moment().year() + n; @@ -116,6 +116,14 @@ async function seed(): Promise { accessType: UserAccessType.MERCH_STORE_DISTRIBUTOR, }); + const RESUME_URL = 'https://acmucsd-local.s3.us-west-1.amazonaws.com/resumeSeedingData/alexface.pdf'; + + const USER_VISIBLE_RESUME = UserFactory.fake(); + const RESUME_1 = ResumeFactory.fake({ user: USER_VISIBLE_RESUME, isResumeVisible: true, url: RESUME_URL }); + + const USER_HIDDEN_RESUME = UserFactory.fake(); + const RESUME_2 = ResumeFactory.fake({ user: USER_HIDDEN_RESUME, isResumeVisible: false, url: RESUME_URL }); + // create members in bulk for testing things like sliding leaderboard in a realistic manner const otherMembers = UserFactory.create(200); const highAttendanceMembers = otherMembers.slice(0, 50); @@ -549,6 +557,8 @@ async function seed(): Promise { USER_MARKETING, USER_MERCH_STORE_MANAGER, USER_MERCH_STORE_DISTRIBUTOR, + USER_VISIBLE_RESUME, + USER_HIDDEN_RESUME, ...otherMembers, ) .createEvents( @@ -642,6 +652,8 @@ async function seed(): Promise { .orderMerch(MEMBER_SOPHOMORE, [{ option: MERCH_ITEM_2_OPTION_2X2, quantity: 1 }], ONGOING_ORDER_PICKUP_EVENT) .orderMerch(MEMBER_JUNIOR, [{ option: MERCH_ITEM_2_OPTION_4X4, quantity: 2 }], ONGOING_ORDER_PICKUP_EVENT) .orderMerch(MEMBER_SENIOR, [{ option: MERCH_ITEM_2_OPTION_3X3, quantity: 1 }], ONGOING_ORDER_PICKUP_EVENT) + .createResumes(USER_VISIBLE_RESUME, RESUME_1) + .createResumes(USER_HIDDEN_RESUME, RESUME_2) .write(); } diff --git a/tests/data/index.ts b/tests/data/index.ts index e760ea5a..be09679f 100644 --- a/tests/data/index.ts +++ b/tests/data/index.ts @@ -3,5 +3,6 @@ export * from './DatabaseConnection'; export * from './UserFactory'; export * from './EventFactory'; export * from './MerchFactory'; +export * from './ResumeFactory'; export * from './PortalState';