Skip to content

Commit

Permalink
Fix integration tests after change notification text
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <vitor@php.rio>
  • Loading branch information
vitormattos committed Mar 9, 2024
1 parent de80422 commit 0d6a954
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
4 changes: 2 additions & 2 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@ public function iFetchTheSignerUuidFromNotification(): void {
$found = array_filter(
$data,
function ($notification) {
return $notification['subject'] === 'There is a file for you to sign';
return $notification['subject'] === 'admin invited you to sign document';
}
);
if (empty($found)) {
throw new Exception('Notification with the subject [There is a file for you to sign] not found');
throw new Exception('Notification with the subject [admin invited you to sign document] not found');
}
$found = current($found);

Expand Down
22 changes: 12 additions & 10 deletions tests/integration/features/page/sign_identify_account.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ Feature: page/sign_identify_account
| users | [{"identify":{"account":"signer1"}}] |
| name | document |
And the response should have a status code 200
And user signer1 has the following notifications
| app | object_type | object_id | subject |
| libresign | sign | document | There is a file for you to sign |
And as user "signer1"
And sending "get" to ocs "/apps/libresign/api/v1/file/list"
When as user "signer1"
And sending "get" to ocs "/apps/notifications/api/v2/notifications"
Then the response should be a JSON array with the following mandatory values
| key | value |
| ocs | (jq).data\|.[].subject == "admin invited you to sign document"|
When sending "get" to ocs "/apps/libresign/api/v1/file/list"
And the response should have a status code 200
And the file to sign contains
| key | value |
Expand Down Expand Up @@ -66,11 +67,12 @@ Feature: page/sign_identify_account
| users | [{"identify":{"account":"signer1"}}] |
| name | document |
And the response should have a status code 200
And user signer1 has the following notifications
| app | object_type | object_id | subject |
| libresign | sign | document | There is a file for you to sign |
And as user "signer1"
And sending "get" to ocs "/apps/libresign/api/v1/file/list"
When as user "signer1"
And sending "get" to ocs "/apps/notifications/api/v2/notifications"
Then the response should be a JSON array with the following mandatory values
| key | value |
| ocs | (jq).data\|.[].subject == "admin invited you to sign document"|
When sending "get" to ocs "/apps/libresign/api/v1/file/list"
And the response should have a status code 200
And the file to sign contains
| key | value |
Expand Down
16 changes: 10 additions & 6 deletions tests/integration/features/sign/request.feature
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,11 @@ Feature: request-signature
| users | [{"identify":{"account":"signer1"}}] |
| name | document |
Then the response should have a status code 200
And user signer1 has the following notifications
| app | object_type | object_id | subject |
| libresign | sign | document | There is a file for you to sign |
When as user "signer1"
And sending "get" to ocs "/apps/notifications/api/v2/notifications"
Then the response should be a JSON array with the following mandatory values
| key | value |
| ocs | (jq).data\|.[].subject == "admin invited you to sign document"|
And there should be 0 emails in my inbox

Scenario: Request to sign with success using email as identifier
Expand Down Expand Up @@ -313,9 +315,11 @@ Feature: request-signature
| users | [{"identify":{"email":"signer1@domain.test"}},{"identify":{"account":"signer1"}}] |
| name | document |
Then the response should have a status code 200
And user signer1 has the following notifications
| app | object_type | object_id | subject |
| libresign | sign | document | There is a file for you to sign |
When as user "signer1"
And sending "get" to ocs "/apps/notifications/api/v2/notifications"
Then the response should be a JSON array with the following mandatory values
| key | value |
| ocs | (jq).data\|.[].subject == "admin invited you to sign document"|
And there should be 1 emails in my inbox
And I open the latest email to "signer1@domain.test" with subject "LibreSign: There is a file for you to sign"

Expand Down

0 comments on commit 0d6a954

Please sign in to comment.