Skip to content

[tests-only][full-ci] add test to disable in-app notification for share removed event by federated user #10997

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

Merged
merged 1 commit into from
Apr 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions tests/acceptance/features/apiOcm/ocmNotifications.feature
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,94 @@ Feature: ocm notifications
Token: %fed_invitation_token%
ProviderDomain: %local_base_url%
"""

@issue-11042
Scenario: no in-app notification should pop-up for unshared resource when "Share Removed" event is disabled
Given using server "REMOTE"
And user "Brian" has been created with default attributes
And "Brian" has created the federation share invitation
And using server "LOCAL"
And "Alice" has accepted invitation
And user "Alice" has uploaded file with content "ocm test" to "textfile.txt"
And user "Alice" has sent the following resource share invitation to federated user:
| resource | textfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And using server "REMOTE"
When user "Brian" disables notification for the following event using the settings API:
| event | Share Removed |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so same event is used for federated share ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as it is using the same settings id.
See:

case events.OCMCoreShareCreated:

| notificationTypes | 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-share-removed-options" }
}
},
"value":{
"type": "object",
"required": ["id","bundleId","settingId","accountUuid","resource","collectionValue"],
"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" }
}
},
"collectionValue":{
"type": "object",
"required":["values"],
"properties": {
"values":{
"type": "array",
"maxItems": 1,
"minItems": 1,
"items": {
"oneOf": [
{
"type": "object",
"required": ["key","boolValue"],
"properties": {
"key":{ "const": "in-app" },
"boolValue":{ "const": false }
}
}
]
}
}
}
}
}
}
}
}
}
}
"""
And using server "LOCAL"
And user "Alice" has removed the access of user "Brian" from resource "textfile.txt" of space "Personal"
And using server "REMOTE"
And user "Brian" should get a notification with subject "Resource shared" and message:
| message |
| Alice Hansen shared textfile.txt with you |
And user "Brian" should not have a notification related to resource "textfile.txt" with subject "Resource unshared"