diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 5cf37e56ab..7a619f2923 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -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); diff --git a/tests/integration/features/federation/call.feature b/tests/integration/features/federation/call.feature index e81767d4a4..ab0949204c 100644 --- a/tests/integration/features/federation/call.feature +++ b/tests/integration/features/federation/call.feature @@ -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 |