Skip to content
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

Merged
merged 3 commits into from
Oct 23, 2023
Merged

Conversation

stanislaw-zakrzewski
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2023

Codecov Report

Merging #37 (fddec66) into main (2f5a8f1) will increase coverage by 17.60%.
The diff coverage is 100.00%.

@@             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     
Files Coverage Δ
data-serving/data-service/src/controllers/case.ts 76.50% <100.00%> (ø)
data-serving/data-service/src/index.ts 85.88% <100.00%> (ø)
data-serving/data-service/src/model/day0-case.ts 90.90% <100.00%> (+0.16%) ⬆️

... and 110 files with indirect coverage changes

Comment on lines +1297 to +1299
expect(
JSON.parse(JSON.stringify((await CaseRevision.find())[0].case)),
).toEqual(JSON.parse(JSON.stringify(c.toObject())));
Copy link
Contributor

@jim-sheldon jim-sheldon Oct 23, 2023

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.

Copy link
Collaborator Author

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.

@stanislaw-zakrzewski stanislaw-zakrzewski merged commit e76149e into main Oct 23, 2023
3 checks passed
@stanislaw-zakrzewski stanislaw-zakrzewski deleted the 36-track-changes-of-case branch October 24, 2023 06:50
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.

3 participants