Skip to content

Commit

Permalink
fixup! fixup! feat(call): Direct endpoint to check if call notificati…
Browse files Browse the repository at this point in the history
…on should be dismissed
  • Loading branch information
nickvergessen committed Dec 4, 2024
1 parent de23b4b commit ab8f65c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
15 changes: 15 additions & 0 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2128,6 +2128,21 @@ public function userJoinsCall(string $user, string $identifier, int $statusCode,
}
}

/**
* @Then /^user "([^"]*)" checks call notification for "([^"]*)" with (\d+) \((v4)\)$/
*
* @param string $user
* @param string $identifier
* @param int $statusCode
* @param string $apiVersion
* @param TableNode|null $formData
*/
public function userChecksCallNotification(string $user, string $identifier, int $statusCode, string $apiVersion, ?TableNode $formData = null): void {
$this->setCurrentUser($user);
$this->sendRequest('GET', '/apps/spreed/api/' . $apiVersion . '/call/' . self::$identifierToToken[$identifier] . '/notification');
$this->assertStatusCode($this->response, $statusCode);
}

/**
* @Then /^user "([^"]*)" updates call flags in room "([^"]*)" to "([^"]*)" with (\d+) \((v4)\)$/
*
Expand Down
8 changes: 7 additions & 1 deletion tests/integration/features/callapi/notifications.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ Feature: callapi/notifications
And user "participant1" adds user "participant2" to room "room" with 200 (v4)
Given user "participant1" joins room "room" with 200 (v4)
Given user "participant2" joins room "room" with 200 (v4)
Then user "participant2" checks call notification for "room" with 201 (v4)
Given user "participant1" joins call "room" with 200 (v4)
Then user "participant2" checks call notification for "room" with 200 (v4)
Then user "participant2" has the following notifications
| app | object_type | object_id | subject |
| spreed | call | room | A group call has started in room |
Given user "participant2" joins call "room" with 200 (v4)
Then user "participant2" checks call notification for "room" with 201 (v4)
Then user "participant2" has the following notifications
| app | object_type | object_id | subject |

Expand All @@ -26,7 +29,9 @@ Feature: callapi/notifications
And user "participant1" adds user "participant2" to room "room" with 200 (v4)
Given user "participant1" joins room "room" with 200 (v4)
Given user "participant2" joins room "room" with 200 (v4)
Then user "participant2" checks call notification for "room" with 201 (v4)
Given user "participant1" joins call "room" with 200 (v4)
Then user "participant2" checks call notification for "room" with 200 (v4)
Then user "participant2" sees the following system messages in room "room" with 200
| room | actorType | actorId | systemMessage | message | silent | messageParameters |
| room | users | participant1 | call_started | {actor} started a call | !ISSET | {"actor":{"type":"user","id":"participant1","name":"participant1-displayname"}} |
Expand All @@ -36,6 +41,7 @@ Feature: callapi/notifications
| app | object_type | object_id | subject |
| spreed | call | room | A group call has started in room |
Given user "participant1" leaves call "room" with 200 (v4)
Then user "participant2" checks call notification for "room" with 201 (v4)
Then user "participant2" has the following notifications
| app | object_type | object_id | subject |
| spreed | call | room | You missed a group call in room |
Expand Down Expand Up @@ -76,7 +82,7 @@ Feature: callapi/notifications
Then user "participant2" has the following notifications
| app | object_type | object_id | subject |
| spreed | call | room | A group call has started in room |

Scenario: Calling an attendee that is in DND throws an error 'status' message with 400
When user "participant1" creates room "room" (v4)
| roomType | 2 |
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/features/federation/call.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ Feature: federation/call
| LOCAL::room | room | 2 | LOCAL | room |
And using server "LOCAL"
And user "participant1" joins room "room" with 200 (v4)
And using server "REMOTE"
Then user "participant2" checks call notification for "LOCAL::room" with 201 (v4)
And using server "LOCAL"
And user "participant1" joins call "room" with 200 (v4)
| flags | 3 |
And using server "REMOTE"
Then user "participant2" checks call notification for "LOCAL::room" with 200 (v4)
And user "participant2" joins room "LOCAL::room" with 200 (v4)
And user "participant2" is participant of room "LOCAL::room" (v4)
| callFlag |
Expand All @@ -35,8 +39,10 @@ Feature: federation/call
| actorType | actorId | inCall |
| federated_users | participant1@{$LOCAL_URL} | 3 |
| users | participant2 | 0 |
Then user "participant2" checks call notification for "LOCAL::room" with 200 (v4)
When user "participant2" joins call "LOCAL::room" with 200 (v4)
| flags | 7 |
Then user "participant2" checks call notification for "LOCAL::room" with 404 (v4)
Then using server "LOCAL"
And user "participant1" is participant of room "room" (v4)
| callFlag |
Expand Down Expand Up @@ -254,11 +260,16 @@ Feature: federation/call
| id | name | type | remoteServer | remoteToken |
| LOCAL::room | room | 2 | LOCAL | room |
And user "participant2" joins room "LOCAL::room" with 200 (v4)
Then user "participant2" checks call notification for "LOCAL::room" with 201 (v4)
And using server "LOCAL"
And user "participant1" joins room "room" with 200 (v4)
And user "participant1" joins call "room" with 200 (v4)
And using server "REMOTE"
Then user "participant2" checks call notification for "LOCAL::room" with 200 (v4)
And using server "LOCAL"
When user "participant1" leaves call "room" with 200 (v4)
Then using server "REMOTE"
Then user "participant2" checks call notification for "LOCAL::room" with 201 (v4)
And user "participant2" has the following notifications
| app | object_type | object_id | subject |
| spreed | call | LOCAL::room | You missed a group call in room |
Expand Down

0 comments on commit ab8f65c

Please sign in to comment.