-
Notifications
You must be signed in to change notification settings - Fork 9
#3165 cadproject file reviews - Create test data for parts #3266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#3165 cadproject file reviews - Create test data for parts #3266
Conversation
src/backend/src/prisma/seed.ts
Outdated
| data: { | ||
| ...partArgs.data, | ||
| assignees: { connect: [{ userId: hawkMan.userId }] }, | ||
| reviewers: { connect: [{ userId: cyborg.userId }] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you have thomas ermax be the reviewer on some, and requester on some other ones? This will make it easier when building out the frontend because people won't have to be on different user accounts to see both functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented changes!
src/backend/tests/test-utils.ts
Outdated
| userCreated: { connect: { userId: userCreatedId } } | ||
| } | ||
| }); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to some changes about how we are going to go about the order of development, we actually don't need this function anymore, so can you get rid of the changes on this file? Sorry for the confusion this is completely on me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented changes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you accidentally committed a .zip - also, don't forget to fix the merge conflicts plz
…project-file-reviews---create-test-data-for-parts
|
removed .zip, and fixed requested changes. Please let me know further if there are more issues, or if I implemented the fixes incorrectly |
…a-for-parts' of https://github.com/Northeastern-Electric-Racing/FinishLine into #3165-KaungMo-cadproject-file-reviews---create-test-data-for-parts
chpy04
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few minor changes
src/backend/src/prisma/seed.ts
Outdated
| * PARTS | ||
| */ | ||
| let i = 0; | ||
| for (const createPart of Object.values(dbSeedAllParts)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im a little confused, where are the parts with the createPart args made? Ideally we should be able to just pass these into a prisma.part.Create, and then we wouldn't need to use the test functions in the seed file. If I'm missing something let me know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved in meeting!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah i changed the named from 'createPart' to 'testPart'. I was trying to initiate previous .seed.ts files in the way they create test objects, so every 'createPart' was a function, which uses Prisma.PartCreateArgs, not the now removed createTestPart function which existed in test-utils.ts file.
chpy04
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @walker-sean ?
Changes
Notes
Please let me know if there are things I need to fix, or if I did something the wrong way!
Also let me know if I should write more tests
I wasn't able to run yarn test:backend since for some reason it said the command didn't exist.
Test Cases
Checklist
It can be helpful to check the
ChecksandFiles changedtabs.Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.
yarn.lockchanges (unless dependencies have changed)Closes #3165