test(federation): Add a test to change call notification settings in federated conversations

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling
2025-07-15 08:52:23 +02:00
parent 1db6ff6932
commit 72a2e56de6
2 changed files with 39 additions and 0 deletions

View File

@ -1350,6 +1350,25 @@ class FeatureContext implements Context, SnippetAcceptingContext {
$this->assertStatusCode($this->response, 200);
}
#[Then('/^user "([^"]*)" sets call notifications to (enabled|disabled) for room "([^"]*)" \((v4)\)$/')]
public function userSetsCallNotificationLevelForRoom(string $user, string $level, string $identifier, string $apiVersion): void {
$this->setCurrentUser($user);
$intLevel = 1; // default
if ($level === 'disabled') {
$intLevel = 0;
}
$this->sendRequest(
'POST', '/apps/spreed/api/' . $apiVersion . '/room/' . self::$identifierToToken[$identifier] . '/notify-calls',
new TableNode([
['level', $intLevel],
])
);
$this->assertStatusCode($this->response, 200);
}
#[Then('/^user "([^"]*)" leaves room "([^"]*)" with (\d+) \((v4)\)$/')]
public function userExitsRoom(string $user, string $identifier, int $statusCode, string $apiVersion): void {
$this->setCurrentUser($user);

View File

@ -317,6 +317,26 @@ Feature: federation/call
And user "participant1" has the following notifications
| app | object_type | object_id | subject |
Scenario: Turning off call notifications also works
Given user "participant1" creates room "room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds federated_user "participant2" to room "room" with 200 (v4)
And using server "REMOTE"
And user "participant2" has the following invitations (v1)
| remoteServerUrl | remoteToken | state | inviterCloudId | inviterDisplayName |
| LOCAL | room | 0 | participant1@LOCAL | participant1-displayname |
And user "participant2" accepts invite to room "room" of server "LOCAL" with 200 (v1)
| id | name | type | remoteServer | remoteToken |
| LOCAL::room | room | 2 | LOCAL | room |
And user "participant2" sets call notifications to disabled for room "LOCAL::room" (v4)
And using server "LOCAL"
And user "participant1" joins room "room" with 200 (v4)
When user "participant1" joins call "room" with 200 (v4)
And using server "REMOTE"
And user "participant2" has the following notifications
| app | object_type | object_id | subject |
Scenario: missed silent call by federated user does not trigger call notification
Given user "participant1" creates room "room" (v4)
| roomType | 2 |