Skip to content

Conversation

@mokaung
Copy link
Contributor

@mokaung mokaung commented Feb 27, 2025

Changes

  • Created test function createTestPart in test-utils.ts
  • Created test objects in parts.seed.ts
  • Created examples in seed.ts

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

  • Basic Part
  • Part without desription
  • Part without Image
  • Part with empty history
  • Part with long name
  • Part with negative index
  • Part with index zero
  • Part with large index
  • Part with 'Ready to Review' tag
  • Part with 'In Review' tag
  • Part with 'Reviewed' tag
  • Part with 'Approved' tag
  • Part with current date
  • Part with past date
  • Part with Unix Epoch date
  • Part with future date
  • Part with Leap year date

Checklist

It can be helpful to check the Checks and Files changed tabs.
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.

  • [ x ] All commits are tagged with the ticket number
  • [ x ] No linting errors / newline at end of file warnings
  • [ x ] All code follows repository-configured prettier formatting
  • [ x ] No merge conflicts
  • [ x ] All checks passing
  • [ x ] Screenshots of UI changes (see Screenshots section)
  • [ x ] Remove any non-applicable sections of this template
  • [ x ] Assign the PR to yourself
  • [ x ] No yarn.lock changes (unless dependencies have changed)
  • [ x ] Request reviewers & ping on Slack
  • [ x ] PR is linked to the ticket (fill in the closes line below)

Closes #3165

@mokaung mokaung linked an issue Feb 27, 2025 that may be closed by this pull request
@chpy04 chpy04 changed the base branch from develop to feature/cad-project-file-review March 3, 2025 19:07
data: {
...partArgs.data,
assignees: { connect: [{ userId: hawkMan.userId }] },
reviewers: { connect: [{ userId: cyborg.userId }] }
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implemented changes!

userCreated: { connect: { userId: userCreatedId } }
}
});
};
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implemented changes!

Copy link
Member

@walker-sean walker-sean left a 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

@mokaung
Copy link
Contributor Author

mokaung commented Mar 11, 2025

removed .zip, and fixed requested changes. Please let me know further if there are more issues, or if I implemented the fixes incorrectly

Copy link
Contributor

@chpy04 chpy04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few minor changes

* PARTS
*/
let i = 0;
for (const createPart of Object.values(dbSeedAllParts)) {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved in meeting!

Copy link
Contributor Author

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 chpy04 self-requested a review March 13, 2025 01:31
Copy link
Contributor

@chpy04 chpy04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @walker-sean ?

@walker-sean walker-sean merged commit 0a0dda7 into feature/cad-project-file-review Mar 23, 2025
4 checks passed
@walker-sean walker-sean deleted the #3165-KaungMo-cadproject-file-reviews---create-test-data-for-parts branch March 23, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAD/Project File Reviews] - Create Test Data for Parts

4 participants