test: add search result thread test

Signed-off-by: Anna Larch <anna@nextcloud.com>
This commit is contained in:
Anna Larch 2025-09-08 18:42:28 +02:00
parent 2cd430038c
commit 0d566d828c
2 changed files with 17 additions and 3 deletions

View file

@ -2795,6 +2795,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
if (isset($result['attributes.conversation'])) {
$result['attributes.conversation'] = self::$identifierToToken[$result['attributes.conversation']];
}
if (isset($result['attributes.threadId'])) {
$result['attributes.threadId'] = self::$titleToThreadId[$result['attributes.threadId']];
}
if (isset($result['attributes.messageId'])) {
$result['attributes.messageId'] = self::$textToMessageId[$result['attributes.messageId']];
}
@ -2815,6 +2818,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
if (isset($actual['attributes']['messageId'])) {
$compare['attributes.messageId'] = $actual['attributes']['messageId'];
}
if (isset($actual['attributes']['threadId'])) {
$compare['attributes.threadId'] = $actual['attributes']['threadId'];
}
return $compare;
}, $results));
}

View file

@ -21,12 +21,16 @@ Feature: chat-2/search
And user "participant1" adds user "participant2" to room "room2" with 200 (v4)
And user "participant1" sends message "Message 1" to room "room1" with 201
And user "participant1" sends message "Message 2" to room "room2" with 201
And user "participant1" sends thread "Thread 1" with message "Thread 1" to room "room1" with 201
And user "participant2" sends reply "Thread 1-1" on thread "Thread 1" to room "room1" with 201
When user "participant1" shares "welcome.txt" with room "room1"
| talkMetaData | {"caption":"Message 3"} |
Then user "participant1" sees the following messages in room "room1" with 200
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| room1 | users | participant1 | participant1-displayname | Message 3 | "IGNORE" |
| room1 | users | participant1 | participant1-displayname | Message 1 | [] |
| room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage |
| room1 | users | participant1 | participant1-displayname | Message 3 | "IGNORE" | |
| room1 | users | participant2 | participant2-displayname | Thread 1-1 | [] | Thread 1 |
| room1 | users | participant1 | participant1-displayname | Thread 1 | [] | |
| room1 | users | participant1 | participant1-displayname | Message 1 | [] | |
When user "participant2" searches for messages with "essa" in room "room1" with 200
| title | subline | attributes.conversation | attributes.messageId |
| participant1-displayname | Message 3 | room1 | Message 3 |
@ -44,6 +48,10 @@ Feature: chat-2/search
| title | subline | attributes.conversation | attributes.messageId |
| participant1-displayname | Message 3 | room1 | Message 3 |
| participant1-displayname | Message 1 | room1 | Message 1 |
When user "participant2" searches for messages with "read" in room "room1" with 200
| title | subline | attributes.conversation | attributes.threadId | attributes.messageId |
| participant2-displayname | Thread 1-1 | room1 | Thread 1 | Thread 1-1 |
| participant1-displayname | Thread 1 | room1 | Thread 1 | Thread 1 |
Scenario: Can not search when being blocked by the lobby
Given user "participant1" creates room "room" (v4)