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

204 tests for rewarding badges #223

Merged
merged 1 commit into from
Mar 22, 2019
Merged

Conversation

roschaefer
Copy link
Contributor

cc @Tirokk

Copy link
Contributor Author

@roschaefer roschaefer left a comment

Choose a reason for hiding this comment

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

Ahh, I cannot approve, since I created the PR. Ok, it seems everyone has to move PR by herself.

@@ -25,6 +25,8 @@ type Mutation {
report(id: ID!, description: String): Report
disable(id: ID!): ID
enable(id: ID!): ID
reward(fromBadgeId: ID!, toUserId: ID!): ID
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm wondering why you return ID here 🤔 . To me, it would make sense to return [Reward]. So instead of the id of the rewarded user you would get the updated set of rewards of that user. This would simplify the test, too 😉

@mattwr18 @Tirokk this is an optional change though. I like this PR and it's mergeable, all tests pass, so I'll approve. When we touch the behaviour again (e.g. when implementing frontend part) it would make sense to improve it.

Copy link
Member

Choose a reason for hiding this comment

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

I had talked about this in the last pairing session we had together on this @roschaefer
I didn't make changes to the logic of the PR, I just took advantage of MERGE in cypher to enforce uniqueness and got the tests passing.

It makes sense to me to return the Reward as well although @Kachulio1 was saying maybe we just return a Boolean... either way I'm happy to make the change and I'm sure @Tirokk won't have an issue with it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reward is a single reward [Reward] is a list of rewards. This list could reflect the list after updating. This way, you don't have to re-check this list in the test..

@roschaefer roschaefer merged commit a1848e8 into master Mar 22, 2019
@roschaefer roschaefer deleted the 204-tests-for-rewarding-badges branch March 22, 2019 10:49
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.

2 participants