Skip to content

Commit

Permalink
add test to enable notifications for space membership event
Browse files Browse the repository at this point in the history
Signed-off-by: prashant-gurung899 <[email protected]>
  • Loading branch information
prashant-gurung899 committed Jan 21, 2025
1 parent 3fc5ae9 commit d06cc61
Showing 1 changed file with 256 additions and 1 deletion.
257 changes: 256 additions & 1 deletion tests/acceptance/features/apiSettings/notificationSetting.feature
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,259 @@ Feature: Notification Settings
And user "Brian" should have "0" emails
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the notifications should be empty
And the notifications should be empty


Scenario: enable mail and in-app notification for Added as space member event
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "newSpace" with the default quota using the Graph API
When user "Brian" enables notification for the following events using the settings API:
| Added as space member | mail,in-app |
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": "event-space-shared-options"
}
}
},
"value":{
"type": "object",
"required": [
"id",
"bundleId",
"settingId",
"accountUuid",
"resource",
"collectionValue"
],
"properties":{
"id":{
"pattern":"%user_id_pattern%"
},
"bundleId":{
"pattern":"%user_id_pattern%"
},
"settingId":{
"pattern":"%user_id_pattern%"
},
"accountUuid":{
"pattern":"%user_id_pattern%"
},
"resource":{
"type": "object",
"required":["type"],
"properties": {
"type":{
"const": "TYPE_USER"
}
}
},
"collectionValue":{
"type": "object",
"required":["values"],
"properties": {
"values":{
"type": "array",
"maxItems": 2,
"minItems": 2,
"uniqueItems": true,
"items": {
"oneOf": [
{
"type": "object",
"required": [
"key",
"boolValue"
],
"properties": {
"key":{
"const": "mail"
},
"boolValue":{
"const": true
}
}
},
{
"type": "object",
"required": [
"key",
"boolValue"
],
"properties": {
"key":{
"const": "in-app"
},
"boolValue":{
"const": true
}
}
}
]
}
}
}
}
}
}
}
}
}
}
"""
And user "Alice" has sent the following space share invitation:
| space | newSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And user "Brian" should have a notification with subject "Space shared" and message:
| message |
| Alice Hansen added you to Space newSpace |


Scenario: disbale mail and in-app notification for Added as space member event
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "newSpace" with the default quota using the Graph API
When user "Brian" disables notification for the following events using the settings API:
| Added as space member | mail,in-app |
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": "event-space-shared-options"
}
}
},
"value":{
"type": "object",
"required": [
"id",
"bundleId",
"settingId",
"accountUuid",
"resource",
"collectionValue"
],
"properties":{
"id":{
"pattern":"%user_id_pattern%"
},
"bundleId":{
"pattern":"%user_id_pattern%"
},
"settingId":{
"pattern":"%user_id_pattern%"
},
"accountUuid":{
"pattern":"%user_id_pattern%"
},
"resource":{
"type": "object",
"required":["type"],
"properties": {
"type":{
"const": "TYPE_USER"
}
}
},
"collectionValue":{
"type": "object",
"required":["values"],
"properties": {
"values":{
"type": "array",
"maxItems": 2,
"minItems": 2,
"uniqueItems": true,
"items": {
"oneOf": [
{
"type": "object",
"required": [
"key",
"boolValue"
],
"properties": {
"key":{
"const": "mail"
},
"boolValue":{
"const": false
}
}
},
{
"type": "object",
"required": [
"key",
"boolValue"
],
"properties": {
"key":{
"const": "in-app"
},
"boolValue":{
"const": false
}
}
}
]
}
}
}
}
}
}
}
}
}
}
"""
And user "Alice" has sent the following space share invitation:
| space | newSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
And user "Brian" should have "0" emails
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the notifications should be empty

0 comments on commit d06cc61

Please sign in to comment.