summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-06-22 10:50:50 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-06-22 10:01:44 +0000
commit4190020a00047803d87ea2d83c2a686f9209f6c9 (patch)
tree2052aa1eaa98fa967441ab8cc1210d3f090febc5 /tests
parentbbef4854b035354081cf1726986f2f2f35f4a943 (diff)
fix(participants): Update cached displayname when a group is renamed
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/features/bootstrap/FeatureContext.php19
-rw-r--r--tests/integration/features/conversation/group-participants.feature16
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php
index 97c842e9f..2b3b7b1b6 100644
--- a/tests/integration/features/bootstrap/FeatureContext.php
+++ b/tests/integration/features/bootstrap/FeatureContext.php
@@ -652,6 +652,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
if (isset($expectedKeys['attendeePermissions'])) {
$data['attendeePermissions'] = (string) $attendee['attendeePermissions'];
}
+ if (isset($expectedKeys['displayName'])) {
+ $data['displayName'] = (string) $attendee['displayName'];
+ }
if (!isset(self::$userToAttendeeId[$identifier][$attendee['actorType']])) {
self::$userToAttendeeId[$identifier][$attendee['actorType']] = [];
@@ -3047,6 +3050,22 @@ class FeatureContext implements Context, SnippetAcceptingContext {
$this->createdGroups[] = $group;
}
+ /**
+ * @Given /^set display name of group "([^"]*)" to "([^"]*)"$/
+ * @param string $groupId
+ * @param string $displayName
+ */
+ public function renameGroup(string $groupId, string $displayName): void {
+ $currentUser = $this->currentUser;
+ $this->setCurrentUser('admin');
+ $this->sendRequest('PUT', '/cloud/groups/' . urlencode($groupId), [
+ 'key' => 'displayname',
+ 'value' => $displayName,
+ ]);
+
+ $this->assertStatusCode($this->response, 200);
+ }
+
private function deleteGroup($group) {
$currentUser = $this->currentUser;
$this->setCurrentUser('admin');
diff --git a/tests/integration/features/conversation/group-participants.feature b/tests/integration/features/conversation/group-participants.feature
index e21774fc4..cb62e6bc1 100644
--- a/tests/integration/features/conversation/group-participants.feature
+++ b/tests/integration/features/conversation/group-participants.feature
@@ -5,6 +5,7 @@ Feature: conversation/group-participants
Given user "participant3" exists
And group "group1" exists
And group "group2" exists
+ And group "rename-group" exists
And user "participant2" is member of group "group1"
Scenario: Owner invites a group
@@ -262,3 +263,18 @@ Feature: conversation/group-participants
| actorType | actorId | participantType |
| users | participant1 | 1 |
| groups | group1 | 3 |
+
+ Scenario: Renaming a group reflects in the participant list
+ Given user "participant1" creates room "room" (v4)
+ | roomType | 3 |
+ | roomName | room |
+ And user "participant1" adds group "rename-group" to room "room" with 200 (v4)
+ And user "participant1" sees the following attendees in room "room" with 200 (v4)
+ | actorType | actorId | participantType | displayName |
+ | users | participant1 | 1 | participant1-displayname |
+ | groups | rename-group | 3 | rename-group |
+ When set display name of group "rename-group" to "rename-group-displayname"
+ Then user "participant1" sees the following attendees in room "room" with 200 (v4)
+ | actorType | actorId | participantType | displayName |
+ | users | participant1 | 1 | participant1-displayname |
+ | groups | rename-group | 3 | rename-group-displayname |