-
Notifications
You must be signed in to change notification settings - Fork 0
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
36 track changes of case #37
Conversation
Codecov Report
@@ Coverage Diff @@
## main #37 +/- ##
===========================================
+ Coverage 65.76% 83.37% +17.60%
===========================================
Files 146 36 -110
Lines 4493 1221 -3272
Branches 1352 317 -1035
===========================================
- Hits 2955 1018 -1937
+ Misses 1538 203 -1335
|
expect( | ||
JSON.parse(JSON.stringify((await CaseRevision.find())[0].case)), | ||
).toEqual(JSON.parse(JSON.stringify(c.toObject()))); |
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.
The 0th revision looks like the new case itself...should this test check for the first revision, i.e. the result of the PUT
request?
Following the Mongo document versioning pattern this would mean checking the cases collection and revisions collection.
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.
In this test case we compare a case before update to the case revision that was crated during the update.
So at the beginning of this test we create a new case c
. Then we send a request to update the content of this case, thus generating a new case revision based on case c
. We then compare case c
with case saved in case revision. The result from PUT request will contain an updated case.
The revision numbering might be a little odd. After creating case gets 0 as revision number, and after an update this number is incremented by 1.
No description provided.