Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ describe('InvitesController', () => {
const invite = await prisma.invite.findFirstOrThrow({
where: {
email: TestUsers.PARTICIPANT_UNANSWERED.email,
studyId: TestStudies.TEST_STUDY_2.id,
},
})

Expand Down Expand Up @@ -805,6 +806,7 @@ describe('InvitesController', () => {
const invite = await prisma.invite.findFirstOrThrow({
where: {
email: TestUsers.PARTICIPANT_UNANSWERED.email,
studyId: TestStudies.TEST_STUDY_2.id,
},
})

Expand Down
50 changes: 49 additions & 1 deletion application/common/testing/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,15 @@ export async function seedTests(prisma: PrismaClient) {
participantType: 'STANDARD',
},
})

await prisma.invite.create({
data: {
email: TestUsers.PARTICIPANT_UNANSWERED.email,
status: InviteStatus.ACCEPTED,
studyId: testStudy.id,
expiresAt: new Date('2026-01-01'),
sentAt: new Date('2025-12-15'),
},
})
await prisma.alternativeContact.create({
data: {
participantProfileId: TestUsers.PARTICIPANT_UNANSWERED.id,
Expand Down Expand Up @@ -232,6 +240,16 @@ export async function seedTests(prisma: PrismaClient) {
},
})

await prisma.invite.create({
data: {
email: TestUsers.PARTICIPANT_COMPLETED.email,
status: InviteStatus.ACCEPTED,
studyId: testStudy.id,
expiresAt: new Date('2026-01-01'),
sentAt: new Date('2025-12-15'),
},
})

//Dependent Profile (no user)
await prisma.participantProfile.create({
data: {
Expand Down Expand Up @@ -290,6 +308,16 @@ export async function seedTests(prisma: PrismaClient) {
},
})

await prisma.invite.create({
data: {
email: TestUsers.GUARDIAN_2.email,
status: InviteStatus.ACCEPTED,
studyId: testStudy.id,
expiresAt: new Date('2026-01-01'),
sentAt: new Date('2025-12-15'),
},
})

const testSurveyVersion = await prisma.surveyVersion.create({
data: {
id: 800,
Expand Down Expand Up @@ -495,6 +523,16 @@ export async function seedTests(prisma: PrismaClient) {
},
})

await prisma.invite.create({
data: {
email: TestUsers.GUARDIAN_2.email,
status: InviteStatus.ACCEPTED,
studyId: frontendTestStudy.id,
expiresAt: new Date('2026-01-01'),
sentAt: new Date('2025-12-15'),
},
})

await prisma.participantProfile.update({
where: {
id: participantUnansweredProfile.id,
Expand All @@ -513,6 +551,16 @@ export async function seedTests(prisma: PrismaClient) {
},
})

await prisma.invite.create({
data: {
email: TestUsers.PARTICIPANT_UNANSWERED.email,
status: InviteStatus.ACCEPTED,
studyId: frontendTestStudy.id,
expiresAt: new Date('2026-01-01'),
sentAt: new Date('2025-12-15'),
},
})

await prisma.surveyVersionAnswers.create({
data: {
versionId: frontendTestSurveryVersion.id,
Expand Down
Loading