bounswe/2021SpringGroup2

[Frontend] Badge Functionality Unit Tests

Closed this issue · 3 comments

I have implemented the badge functionality with various pages. All the badge information is kept in the backend; therefore, I think it would be a good idea to check the controller methods for this functionality using mock response. I am planning to check if the responses got from the backend are formatted correctly before used and if the requests sent to the backend are in correct format with method type and body.

I have added several unit tests for the badge functionality. As I planned, I checked if the mock responses are formatted correctly to be used in Badge, BadgeList and other components. I checked if individual badge information, badge list information and related events information in the profile are formatted correctly. I also checked if the request done when sending a badge is in the correct format with correct body and POST method type.

All unit tests pass on GitHub actions, pull request is #352.

Pull request is merged and closed, closing the issue.