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

Backend Release to Main [1.80] #995

Merged
merged 22 commits into from
Jun 20, 2024
Merged

Backend Release to Main [1.80] #995

merged 22 commits into from
Jun 20, 2024

Conversation

one-community
Copy link
Member

Includes: Jordy add notification controller unit tests #925

j-corp-25 and others added 22 commits May 2, 2024 21:49
Added four unit tests covering one positive case and three negative cases. Moved userId error handling to higher level in controller since it makes more sense to check if userId is not present before anything else.
Added 2 negative cases to the unit test suite. Refactored 'htmlContentSanitizer' file because I was getting module error. Also moved up the initial userId check in the notification controller.
Added Positive case 200 for getUserNotifications. Furthermore, I updated the docs for the negative and postive cases. Still need to add one last negative to complete the suite.
Added negative case for getUserNotifications to check 'Internal Error' shows if there is an error in fetching process. Furthermore, I updated the docs for the negative case. Still need refactor the test suite. There is still a lot of repetition in my code
…ations

Added all four test cases for getUnreadUserNotifications.This test suite is essentially the same as getUserNotifications. The controller bahaves the same way. Additionally, updated the docs for the test cases added in the suite.
Added four additional tests for getSentNotifications inside controller. I found a bug while working on this test. Because of how logical operators work in JavaScript, the logic that was set up inside the method would always return false. This is not intended behavior so I corrected it by using '&&' instead of '||'. This is on line 81 of the 'notificationsController'
Added two negative test cases that are for error handling. Came across the same bug again where inside the controller the operator '||' would make the method always throw a forbidden error. Changed the operator to '&&' which fixed this issue.
Added remaining test cases and updated requirements docs. Still need to add 'deleteUserNotifications' and 'markNotificationAsRead'. Aiming to complete them tonight
…uites

Added the remaining tests for marking notification as read and deleting notification. Also, fix more bugs in the controller with the operator not evaluating the function correctly. Next steps are to refactor my tests and trim repeated code
Made use of Diegos 'assertResMock' helper function to slim down some of the tests.
…nController_unit_tests

Jordy add notification controller unit tests
Anirudh - Fetch end date field from dashboardhelper
@one-community one-community merged commit 23a9bae into main Jun 20, 2024
4 checks passed
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