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

[tests-only][full-ci] add test to disable email notifications by federated user #10996

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
60 changes: 58 additions & 2 deletions tests/acceptance/features/apiOcm/ocmNotifications.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ Feature: ocm notifications
I want to manage my notification settings
So that I do not get notified of unimportant events


Scenario: federated user disables mail and in-app notification for "Share Received" event
Background:
Given user "Alice" has been created with default attributes
And user "Alice" has uploaded file with content "ocm test" to "textfile.txt"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And user "Brian" has been created with default attributes
And "Brian" has accepted invitation


Scenario: federated user disables mail and in-app notification for "Share Received" event
When user "Brian" disables notification for the following events using the settings API:
| Share Received | mail,in-app |
Then the HTTP status code should be "201"
Expand Down Expand Up @@ -100,3 +102,57 @@ Feature: ocm notifications
Then the HTTP status code should be "200"
And the notifications should be empty
And user "Brian" should have "0" emails


Scenario: federated user disables email notification
When user "Brian" disables email notification using the settings API
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": "disable-email-notifications" }
}
},
"value":{
"type": "object",
"required": ["id","bundleId","settingId","accountUuid","resource"],
"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" }
}
}
}
}
}
}
}
}
"""
And using server "LOCAL"
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 user "Brian" should have "0" emails