NhatMinh0208 / timetable-together

A web app for collaborative timetabling and scheduling. Part of Orbital 24 (Last Minute Pickup)
https://timetable-together.vercel.app
2 stars 0 forks source link

Add testing to application and create initial set of tests #24

Closed keyansheng closed 4 months ago

keyansheng commented 4 months ago

Resolves #19

keyansheng commented 4 months ago

Right now the first 2 tests depend on the current state of the production database, and would fail if the data in the production database is changed

NhatMinh0208 commented 4 months ago

yeah this is definitely not good testing practice.

probably can just remove those for now

keyansheng commented 4 months ago

maybe we could use beforeEach to set up the database before each test

https://jestjs.io/docs/setup-teardown

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
timetable-together ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2024 3:21pm
NhatMinh0208 commented 4 months ago

should be beforeAll since we are just setting up the database once for all the database tests

alternatively we can just set up a dev database, then we wouldn’t have to worry about this

keyansheng commented 4 months ago

hmmm we don't actually have a function for inserting events

I suppose we can just use the prisma functions directly in tests for now

NhatMinh0208 commented 4 months ago

looks good enough, going to merge once and then we can merge again when we have more tests