From 564686dcdd5f7c1839416c884ea89720687df806 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 18 Sep 2023 20:12:11 +0200 Subject: test(chat): Add integration test for message offset with expiration Signed-off-by: Joas Schilling --- .../features/chat/message-expiration.feature | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') 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 | [] | | -- cgit v1.2.3