Skip to content

Commit 40e57b6

Browse files
fix retry for notification
1 parent 54ef79d commit 40e57b6

File tree

4 files changed

+33
-27
lines changed

4 files changed

+33
-27
lines changed

tests/acceptance/bootstrap/NotificationContext.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -329,20 +329,18 @@ public function filterResponseAccordingToNotificationSubject(
329329
?ResponseInterface $response = null
330330
): object {
331331
$response = $response ?? $this->featureContext->getResponse();
332+
332333
if (isset($this->featureContext->getJsonDecodedResponseBodyContent($response)->ocs->data)) {
333334
$responseBody = $this->featureContext->getJsonDecodedResponseBodyContent($response)->ocs->data;
334335
foreach ($responseBody as $value) {
335336
if (isset($value->subject) && $value->subject === $subject) {
336-
$responseBody = $value;
337337
// set notificationId
338338
$this->notificationIds[] = $value->notification_id;
339-
break;
339+
return $value;
340340
}
341341
}
342-
} else {
343-
$responseBody = $this->featureContext->getJsonDecodedResponseBodyContent($response);
344342
}
345-
return $responseBody;
343+
return (object) [];
346344
}
347345

348346
/**

tests/acceptance/features/apiNotification/notification.feature

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Feature: Notification
88
| username |
99
| Alice |
1010
| Brian |
11-
| Carol |
1211
And user "Alice" has uploaded file with content "other data" to "/textfile1.txt"
1312
And user "Alice" has created folder "my_data"
1413

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@email
2+
Feature: Share Expiry Notification
3+
As a user
4+
I want to be notified when share expires
5+
So that I can stay updated about the share
6+
7+
Background:
8+
Given these users have been created with default attributes:
9+
| username |
10+
| Alice |
11+
| Brian |
12+
13+
14+
Scenario: check share expired in-app and mail notification for Personal space resource
15+
Given user "Alice" has uploaded file with content "hello world" to "testfile.txt"
16+
And user "Alice" has sent the following resource share invitation:
17+
| resource | testfile.txt |
18+
| space | Personal |
19+
| sharee | Brian |
20+
| shareType | user |
21+
| permissionsRole | Viewer |
22+
| expirationDateTime | 2025-07-15T14:00:00Z |
23+
When user "Alice" expires the last created share:
24+
| space | Personal |
25+
| resource | testfile.txt |
26+
Then the HTTP status code should be "200"
27+
And user "Brian" should get a notification with subject "Membership expired" and message:
28+
| message |
29+
| Access to Space Alice Hansen lost |
30+
And user "Brian" should have "2" emails

tests/acceptance/features/apiSettings/notificationSetting.feature

-21
Original file line numberDiff line numberDiff line change
@@ -758,24 +758,3 @@ Feature: Notification Settings
758758
Then the HTTP status code should be "200"
759759
And the notifications should be empty
760760
And user "Brian" should have "0" emails
761-
762-
763-
Scenario: check share expired in-app and mail notification for Personal space resource
764-
Given user "Alice" has uploaded file with content "hello world" to "testfile.txt"
765-
And user "Alice" has sent the following resource share invitation:
766-
| resource | testfile.txt |
767-
| space | Personal |
768-
| sharee | Brian |
769-
| shareType | user |
770-
| permissionsRole | Viewer |
771-
| expirationDateTime | 2025-07-15T14:00:00Z |
772-
When user "Alice" expires the last created share:
773-
| space | Personal |
774-
| resource | testfile.txt |
775-
Then the HTTP status code should be "200"
776-
And for user "Brian" the space "Shares" should not contain these entries:
777-
| testfile.txt |
778-
And user "Brian" should get a notification with subject "Membership expired" and message:
779-
| message |
780-
| Access to Space Alice Hansen lost |
781-
And user "Brian" should have "2" emails

0 commit comments

Comments
 (0)