Skip to content

Commit

Permalink
#2223: fixing tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
martin0he committed Mar 18, 2024
1 parent 5a17678 commit 0458e53
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/backend/tests/design-reviews.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {
designReview1,
designReview3,
designReview4,
designReview5,
prismaDesignReview1,
prismaDesignReview2,
prismaDesignReview3,
prismaDesignReview4,
sharedDesignReview1,
teamType1
} from './test-data/design-reviews.test-data';
Expand Down Expand Up @@ -512,7 +511,7 @@ describe('Design Reviews', () => {
);

expect(prisma.design_Review.findUnique).toHaveBeenCalledTimes(1);
expect(result).toEqual(designReview4);
expect(result).toEqual(designReview5);
});

test('Design Review was not found', async () => {
Expand Down
35 changes: 31 additions & 4 deletions src/backend/tests/test-data/design-reviews.test-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const prismaDesignReview1: Prisma.Design_ReviewGetPayload<typeof designRe
docTemplateLink: null,
wbsElementId: 1,
requiredMembers: [batman],
optionalMembers: [wonderwoman],
optionalMembers: [],
confirmedMembers: [batman],
deniedMembers: [],
attendees: [batman],
Expand Down Expand Up @@ -119,6 +119,33 @@ export const prismaDesignReview3: Prisma.Design_ReviewGetPayload<typeof designRe
teamType: teamType1
};

export const prismaDesignReview5: Prisma.Design_ReviewGetPayload<typeof designReviewQueryArgs> = {
designReviewId: '1',
dateScheduled: new Date('2024-03-25'),
meetingTimes: [0, 1, 2, 3],
dateCreated: new Date('2024-03-10'),
userCreatedId: batman.userId,
userCreated: batman,
status: PrismaDesignReviewStatus.CONFIRMED,
teamTypeId: '1',
teamType: teamType1,
location: null,
isOnline: true,
isInPerson: false,
zoomLink: null,
dateDeleted: null,
userDeletedId: null,
docTemplateLink: null,
wbsElementId: 1,
requiredMembers: [batman],
optionalMembers: [wonderwoman],
confirmedMembers: [batman],
deniedMembers: [],
attendees: [batman],
userDeleted: null,
wbsElement: prismaWbsElement1
};

export const designReview3: DesignReview = {
designReviewId: '2',
dateScheduled: new Date('2024-03-25'),
Expand Down Expand Up @@ -162,21 +189,21 @@ export const sharedDesignReview1: SharedDesignReview = {
wbsNum: { carNumber: 1, projectNumber: 2, workPackageNumber: 0 }
};

export const designReview4: DesignReview = {
export const designReview5: DesignReview = {
designReviewId: '1',
dateScheduled: new Date('2024-03-25'),
meetingTimes: [0, 1, 2, 3],
dateCreated: new Date('2024-03-10'),
userCreated: batman,
status: DesignReviewStatus.CONFIRMED,
teamType: teamType1,
isOnline: true,
isInPerson: false,
requiredMembers: [batman],
optionalMembers: [wonderwoman],
confirmedMembers: [batman, wonderwoman],
confirmedMembers: [batman],
deniedMembers: [],
attendees: [batman],
status: DesignReviewStatus.UNCONFIRMED,
wbsName: 'car',
wbsNum: { carNumber: 1, projectNumber: 2, workPackageNumber: 0 }
};

0 comments on commit 0458e53

Please sign in to comment.