Skip to content

Commit

Permalink
add test to enable receiving email intervals to never
Browse files Browse the repository at this point in the history
Signed-off-by: prashant-gurung899 <[email protected]>
  • Loading branch information
prashant-gurung899 committed Feb 4, 2025
1 parent bf6221a commit c910bb1
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/acceptance/bootstrap/SettingsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ public function userDisablesNotificationForFollowingEventUsingSettingsApi(
$body["value"]["collectionValue"]["values"][]
= ["key" => "in-app","boolValue" => $enableOrDisable === "enables"];
}
if (str_contains($value, "never")) {
$body["value"]["stringValue"]
= "never";
}
$response = SettingsHelper::updateSettings(
$this->featureContext->getBaseUrl(),
$this->featureContext->getActualUsername($user),
Expand Down
60 changes: 60 additions & 0 deletions tests/acceptance/features/apiSettings/notificationSetting.feature
Original file line number Diff line number Diff line change
Expand Up @@ -607,3 +607,63 @@ Feature: Notification Settings
| message |
| Alice Hansen added you to Space new-space |
But user "Brian" should not have a notification related to space "new-space" with subject "Space disabled"


Scenario: no email should be received when email sending interval is set to never
When user "Brian" enables notification for the following events using the settings API:
| Email sending interval | never |
Then the HTTP status code should be "201"
And the JSON data of the response should match
"""
{
"type": "object",
"required": ["value"],
"properties": {
"value": {
"type": "object",
"required": ["identifier","value"],
"properties": {
"identifier":{
"type": "object",
"required": ["extension","bundle","setting"],
"properties": {
"extension":{ "const": "ocis-accounts" },
"bundle":{ "const": "profile" },
"setting":{ "const": "email-sending-interval-options" }
}
},
"value":{
"type": "object",
"required": ["id","bundleId","settingId","accountUuid","resource","stringValue"],
"properties":{
"id":{ "pattern":"%uuidv4_pattern%" },
"bundleId":{ "pattern":"%uuidv4_pattern%" },
"settingId":{ "pattern":"%uuidv4_pattern%" },
"accountUuid":{ "pattern":"%uuidv4_pattern%" },
"resource":{
"type": "object",
"required":["type"],
"properties": {
"type":{ "const": "TYPE_USER" }
}
},
"stringValue":{ "const":"never" }
}
}
}
}
}
}
"""
And user "Alice" has sent the following resource share invitation:
| resource | lorem.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And user "Brian" should get a notification with subject "Resource shared" and message:
| message |
| Alice Hansen shared lorem.txt with you |
And user "Brian" should have "0" emails

0 comments on commit c910bb1

Please sign in to comment.