diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2024-01-22 12:22:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 12:22:47 +0100 |
commit | 0c7ed6776f1f129e3a1f16794f97c3a1be7f8e85 (patch) | |
tree | a2930ed73f73d6ce5563bc5fd1c1406d7bc112b2 /tests/integration | |
parent | 169e562fdafeb16a0a3f989078b489ce43f1fecb (diff) | |
parent | 0e2cafc3ae753af5c497ea79f32c3af4b9d08d60 (diff) |
Merge pull request #11410 from nextcloud/bugfix/noid/document-empty-displayname
fix(docs): Document empty display names
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/features/bootstrap/FeatureContext.php | 11 | ||||
-rw-r--r-- | tests/integration/features/chat-1/edit-message.feature | 24 |
2 files changed, 24 insertions, 11 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index a7ea3a280..f466f615b 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -2576,6 +2576,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { $includeReferenceId = in_array('referenceId', $formData->getRow(0), true); $includeReactions = in_array('reactions', $formData->getRow(0), true); $includeReactionsSelf = in_array('reactionsSelf', $formData->getRow(0), true); + $includeLastEdit = in_array('lastEditActorId', $formData->getRow(0), true); $expected = $formData->getHash(); $count = count($expected); @@ -2615,7 +2616,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { } } - Assert::assertEquals($expected, array_map(function ($message) use ($includeParents, $includeReferenceId, $includeReactions, $includeReactionsSelf) { + Assert::assertEquals($expected, array_map(function ($message) use ($includeParents, $includeReferenceId, $includeReactions, $includeReactionsSelf, $includeLastEdit) { $data = [ 'room' => self::$tokenToIdentifier[$message['token']], 'actorType' => $message['actorType'], @@ -2642,6 +2643,14 @@ class FeatureContext implements Context, SnippetAcceptingContext { $data['reactionsSelf'] = null; } } + if ($includeLastEdit) { + $data['lastEditActorType'] = $message['lastEditActorType'] ?? ''; + $data['lastEditActorDisplayName'] = $message['lastEditActorDisplayName'] ?? ''; + $data['lastEditActorId'] = $message['lastEditActorId'] ?? ''; + if ($message['lastEditActorType'] === 'guests') { + $data['lastEditActorId'] = self::$sessionIdToUser[$message['lastEditActorId']]; + } + } return $data; }, $messages)); } diff --git a/tests/integration/features/chat-1/edit-message.feature b/tests/integration/features/chat-1/edit-message.feature index b6b7cf95c..8d54e8a05 100644 --- a/tests/integration/features/chat-1/edit-message.feature +++ b/tests/integration/features/chat-1/edit-message.feature @@ -38,22 +38,26 @@ Feature: chat-1/edit-message | room | users | participant2 | participant2-displayname | Message 1 | [] | | And user "participant1" edits message "Message 1" in room "room" to "Message 1 - Edit 1" with 200 Then user "participant1" sees the following messages in room "room" with 200 - | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | - | room | users | participant2 | participant2-displayname | Message 1 - Edit 1 | [] | | + | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | lastEditActorType | lastEditActorId | lastEditActorDisplayName | + | room | users | participant2 | participant2-displayname | Message 1 - Edit 1 | [] | | users | participant1 | participant1-displayname | Then user "participant2" sees the following messages in room "room" with 200 - | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | - | room | users | participant2 | participant2-displayname | Message 1 - Edit 1 | [] | | + | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | lastEditActorType | lastEditActorId | lastEditActorDisplayName | + | room | users | participant2 | participant2-displayname | Message 1 - Edit 1 | [] | | users | participant1 | participant1-displayname | And user "participant2" edits message "Message 1 - Edit 1" in room "room" to "Message 1 - Edit 2" with 200 Then user "participant1" sees the following messages in room "room" with 200 - | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | - | room | users | participant2 | participant2-displayname | Message 1 - Edit 2 | [] | | + | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | lastEditActorType | lastEditActorId | lastEditActorDisplayName | + | room | users | participant2 | participant2-displayname | Message 1 - Edit 2 | [] | | users | participant2 | participant2-displayname | Then user "participant2" sees the following messages in room "room" with 200 - | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | - | room | users | participant2 | participant2-displayname | Message 1 - Edit 2 | [] | | + | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | lastEditActorType | lastEditActorId | lastEditActorDisplayName | + | room | users | participant2 | participant2-displayname | Message 1 - Edit 2 | [] | | users | participant2 | participant2-displayname | And user "participant2" edits message "Message 1 - Edit 1" in room "room" to "" with 400 Then user "participant1" sees the following messages in room "room" with 200 - | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | - | room | users | participant2 | participant2-displayname | Message 1 - Edit 2 | [] | | + | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | lastEditActorType | lastEditActorId | lastEditActorDisplayName | + | room | users | participant2 | participant2-displayname | Message 1 - Edit 2 | [] | | users | participant2 | participant2-displayname | + When user "participant2" is deleted + Then user "participant1" sees the following messages in room "room" with 200 + | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | lastEditActorType | lastEditActorId | lastEditActorDisplayName | + | room | deleted_users | deleted_users | | Message 1 - Edit 2 | [] | | deleted_users | deleted_users | | Scenario: Editing a caption Given user "participant1" creates room "room" (v4) |