Skip to content

[tests-only][full-ci] Add tests for share expiry #10935

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
Mar 20, 2025
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions tests/acceptance/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2700,8 +2700,7 @@ public function userExpiresTheLastShareOfResourceInsideOfTheSpace(
string $resource,
string $spaceName
): void {
$dateTime = new DateTime('yesterday');
$rows['expireDate'] = $dateTime->format('Y-m-d\\TH:i:sP');
$rows['expireDate'] = $this->featureContext->formatExpiryDateTime('Y-m-d\\TH:i:sP');
if ($this->featureContext->isUsingSharingNG()) {
$space = $this->getSpaceByName($user, $spaceName);
$itemId = $this->getResourceId($user, $spaceName, $resource);
Expand Down
50 changes: 50 additions & 0 deletions tests/acceptance/features/apiNotification/notification.feature
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,53 @@ Feature: Notification
| resource |
| textfile1.txt |
| my_data |

@issue-10966
Scenario: check share expired in-app and mail notifications for Personal space file
Given using SharingNG
And user "Alice" has uploaded file with content "hello world" to "testfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | testfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Alice" expires the last share of resource "testfile.txt" inside of the space "Personal"
Then the HTTP status code should be "200"
And as "Brian" file "Shares/testfile.txt" should not exist
And user "Brian" should get a notification with subject "Share expired" and message:
| message |
| Access to testfile.txt expired |
And user "Brian" should have received the following email from user "Alice"
"""
Hello Brian Murphy,

Your share to testfile.txt has expired at %expiry_date_in_mail%

Even though this share has been revoked you still might have access through other shares and/or space memberships.
"""

@issue-10966
Scenario: check share expired in-app and mail notifications for Personal space folder
Given using SharingNG
And user "Alice" has created folder "folderToShare"
And user "Alice" has sent the following resource share invitation:
| resource | folderToShare |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Alice" expires the last share of resource "folderToShare" inside of the space "Personal"
Then the HTTP status code should be "200"
And as "Brian" file "Shares/folderToShare" should not exist
And user "Brian" should get a notification with subject "Share expired" and message:
| message |
| Access to folderToShare expired |
And user "Brian" should have received the following email from user "Alice"
"""
Hello Brian Murphy,

Your share to folderToShare has expired at %expiry_date_in_mail%

Even though this share has been revoked you still might have access through other shares and/or space memberships.
"""