-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #925 from OneCommunityGlobal/Jordy_add_notificatio…
…nController_unit_tests Jordy add notification controller unit tests
- Loading branch information
Showing
9 changed files
with
435 additions
and
28 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
requirements/notificationController/creatUserNotification.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Check mark: ✅ | ||
Cross Mark: ❌ | ||
|
||
|
||
# Create User Notification | ||
|
||
## Negative Cases | ||
|
||
1. ✅ Returns error 403 if requestor role is not Admin or Owner | ||
2. ✅ Returns error 400 if message and recipient are missing from request | ||
3. ✅ Returns error 500 if there is an internal error while fetching unread notifications. | ||
|
||
## Positive Cases | ||
|
||
1. ✅ Returns status 200 when notification is successfully created with sender, recipient and message |
14 changes: 14 additions & 0 deletions
14
requirements/notificationController/deleteUserNotification.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Check mark: ✅ | ||
Cross Mark: ❌ | ||
|
||
|
||
# Delete User Notification | ||
|
||
## Negative Cases | ||
|
||
1. ✅ Returns error 403 if requestor role is not Admin or Owner. | ||
2. ✅ Returns error 500 if there is an internal error while deleting notification. | ||
|
||
## Positive Cases | ||
|
||
1. ✅ Returns status 200 when notification is successfully deleted. |
14 changes: 14 additions & 0 deletions
14
requirements/notificationController/getSentNotifications.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Check mark: ✅ | ||
Cross Mark: ❌ | ||
|
||
|
||
# GET Sent Notifications | ||
|
||
## Positive Cases | ||
|
||
1. ✅ Returns status 200 Successful Data Retrieval | ||
|
||
## Negative Cases | ||
|
||
1. ✅ Returns error 403 if requestor role is not Admin or Owner | ||
2. ✅ Returns error 500 if there is an internal error while fetching notifications. |
15 changes: 15 additions & 0 deletions
15
requirements/notificationController/getUnreadUserNotifications.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Check mark: ✅ | ||
Cross Mark: ❌ | ||
|
||
|
||
# GET Unread User Notifications | ||
|
||
## Negative Cases | ||
|
||
1. ✅ Returns error 403 if userId does not match requestorId. | ||
2. ✅ Returns error 400 if the userId is missing from the request. | ||
3. ✅ Returns error 500 if there is an internal error while fetching unread notifications. | ||
|
||
## Positive Cases | ||
|
||
1. ✅ Returns status 200 with notification data when a valid userId is provided by an Administrator or Owner querying another user's notifications. |
15 changes: 15 additions & 0 deletions
15
requirements/notificationController/getUserNotifications.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Check mark: ✅ | ||
Cross Mark: ❌ | ||
|
||
|
||
# GET User Notifications | ||
|
||
## Negative Cases | ||
|
||
1. ✅ Returns error 403 if userId does not match requestorId. | ||
2. ✅ Returns error 400 if the userId is missing from the request. | ||
3. ✅ Returns error 500 if there is an internal error while fetching notifications. | ||
|
||
## Positive Cases | ||
|
||
1. ✅ Returns status 200 with notification data when a valid userId is provided by an Administrator or Owner querying another user's notifications. |
14 changes: 14 additions & 0 deletions
14
requirements/notificationController/markNotificationAsRead.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Check mark: ✅ | ||
Cross Mark: ❌ | ||
|
||
|
||
# Mark Notification as Read | ||
|
||
## Negative Cases | ||
|
||
1. ✅ Returns error 400 if recipientId is missing. | ||
2. ✅ Returns error 500 if there is an internal error while reading notification. | ||
|
||
## Positive Cases | ||
|
||
1. ✅ Returns status 200 when notification is successfully read. |
This file contains 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
Oops, something went wrong.