summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-09-18 20:12:11 +0200
committerJoas Schilling <coding@schilljs.com>2023-09-19 16:40:29 +0200
commit564686dcdd5f7c1839416c884ea89720687df806 (patch)
tree59557f513f641c2c2347aa8f74b29410a140f1c1 /tests
parentdeb906bb9d98f75941156656618d0f36514b47ec (diff)
test(chat): Add integration test for message offset with expiration
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/features/chat/message-expiration.feature22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/integration/features/chat/message-expiration.feature b/tests/integration/features/chat/message-expiration.feature
index c211faa74..8f2e2a2cf 100644
--- a/tests/integration/features/chat/message-expiration.feature
+++ b/tests/integration/features/chat/message-expiration.feature
@@ -18,7 +18,29 @@ Feature: chat/message-expiration
And user "participant1" is participant of the following rooms (v4)
| id | type | messageExpiration |
| room | 3 | 3 |
+ And user "participant1" set the message expiration to 0 of room "room" with 200 (v4)
+ And user "participant1" sends message "Message 3" to room "room" with 201
And wait for 3 seconds
+ And force run "OCA\Talk\BackgroundJob\ExpireChatMessages" background jobs
+ Then user "participant1" sees the following messages in room "room" with 200
+ | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage |
+ | room | users | participant1 | participant1-displayname | Message 3 | [] | |
+ | room | users | participant1 | participant1-displayname | Message 1 | [] | |
+ # Request messages using the expired message as an offset for the future
+ When next message request has the following parameters set
+ | lastCommonReadId | Message 2 |
+ | lastKnownMessageId | Message 2 |
+ | timeout | 0 |
+ | lookIntoFuture | 1 |
+ Then user "participant1" sees the following messages in room "room" with 200
+ | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage |
+ | room | users | participant1 | participant1-displayname | Message 3 | [] | |
+ # Request messages using the expired message as an offset for the past
+ When next message request has the following parameters set
+ | lastCommonReadId | Message 2 |
+ | lastKnownMessageId | Message 2 |
+ | timeout | 0 |
+ | lookIntoFuture | 0 |
Then user "participant1" sees the following messages in room "room" with 200
| room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage |
| room | users | participant1 | participant1-displayname | Message 1 | [] | |