Skip to content

Commit

Permalink
#2313 - changed delete order
Browse files Browse the repository at this point in the history
  • Loading branch information
bracyw committed Jun 16, 2024
1 parent 0c52e65 commit adf7ebc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/backend/tests/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export const createTestUser = async (
};

export const resetUsers = async () => {
await prisma.project.deleteMany();
await prisma.work_Package.deleteMany();
await prisma.project.deleteMany();
await prisma.team_Type.deleteMany();
await prisma.material.deleteMany();
await prisma.manufacturer.deleteMany();
Expand Down Expand Up @@ -305,10 +305,15 @@ export const createTestReimbursementRequest = async () => {
export const createTestDesignReview = async () => {
const organization = await createTestOrganization();
await createFinanceTeamAndLead(organization);
const lead = await createTestUser(aquamanLeadership, organization.organizationId);
const lead = prisma.user.findUnique({
where: {
userId: batmanAppAdmin.email
}
});
if (!lead) throw new Error('Failed to find user');
const appAdmin = await createTestUser(batmanAppAdmin, organization.organizationId);

if (!lead) throw new Error('Failed to find user');
if (!aquamanLeadership) throw new Error('Failed to find user');

const teamType = await TeamsService.createTeamType(appAdmin, 'Team1', 'Software', organization.organizationId);
const dr = await DesignReviewsService.createDesignReview(
Expand Down

0 comments on commit adf7ebc

Please sign in to comment.