Initialize and Protect Problem Count - #39
Open
imad-ant wants to merge 1 commit into
Open
Conversation
This was
linked to
issues
Jun 12, 2020
Member
|
Could we hold off on merging this until I merge the last of the problems tests? I did a lot of refactoring of the controllers, regarding updating problemCount, so there will be changes to make |
Author
|
Sure, will wait :p |
MohamedBeydoun
requested changes
Jun 15, 2020
Comment on lines
+321
to
+325
| const updatedUser = JSON.parse(JSON.stringify(testProblemSet1)); | ||
| updatedUser._id = req.params.problemSetId; | ||
| updatedUser.title = "Test Problem Set Title 1 Updated"; | ||
| updatedUser.problemCount = 9; | ||
| stubs.problemSetDB.update.resolves(updatedUser); |
Member
There was a problem hiding this comment.
Confusing variable name updatedUser. Change to updatedProblemSet.
Also, why do you need to stringify then parse? Isn't testProblemSet1 already a javascript object (IProblemSet)?
Author
There was a problem hiding this comment.
Kept both in line with test that precedes - will change after I update with Val's changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initializes Problem Count field upon creation.
Protects Problem Count from modification on update endpoint.
resolve #33
resolve #14