Skip to content

Commit

Permalink
test(chat): Add integration test for message offset with expiration
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Sep 19, 2023
1 parent deb906b commit 564686d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/integration/features/chat/message-expiration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 | [] | |
Expand Down

0 comments on commit 564686d

Please sign in to comment.