Skip to content

Commit

Permalink
test(federation): Add test for avatar federation
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Mar 13, 2024
1 parent 616b3e0 commit 79e0599
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ public function userHasInvites(string $user, string $apiVersion, TableNode $form
foreach ($invites as $data) {
self::$remoteToInviteId[$this->translateRemoteServer($data['remoteServerUrl']) . '::' . self::$tokenToIdentifier[$data['remoteToken']]] = $data['id'];
self::$inviteIdToRemote[$data['id']] = $this->translateRemoteServer($data['remoteServerUrl']) . '::' . self::$tokenToIdentifier[$data['remoteToken']];
self::$identifierToToken['LOCAL::' . $data['roomName']] = $data['localToken'];
}
}

Expand Down
23 changes: 23 additions & 0 deletions tests/integration/features/federation/invite.feature
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,26 @@ Feature: federation/invite
Then user "participant2" is participant of the following rooms (v4)
| id | name | type |
| room | Federated room | 2 |

Scenario: Allow accessing conversation and room avatars for invited users
Given the following "spreed" app config is set
| federation_enabled | yes |
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 user "participant2" has the following invitations (v1)
| remoteServerUrl | remoteToken | state | inviterCloudId | inviterDisplayName |
| LOCAL | room | 0 | participant1@http://localhost:8080 | participant1-displayname |
When as user "participant2"
Then the room "LOCAL::room" has an avatar with 200
And user "participant2" accepts invite to room "room" of server "LOCAL" with 200 (v1)
| id | name | type | remoteServer | remoteToken |
| room | room | 2 | LOCAL | room |
When as user "participant2"
Then the room "LOCAL::room" has an avatar with 200
And user "participant2" removes themselves from room "LOCAL::room" with 200 (v4)
And user "participant2" has the following invitations (v1)
| remoteServerUrl | remoteToken | state | inviterCloudId | inviterDisplayName |
When as user "participant2"
Then the room "LOCAL::room" has an avatar with 404

0 comments on commit 79e0599

Please sign in to comment.