Skip to content

Commit

Permalink
feat(tests): Add first mention notification test
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jan 10, 2024
1 parent 9cb86a6 commit 62c3f13
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/integration/features/chat-1/edit-message.feature
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,28 @@ Feature: chat-1/edit-message
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 | [] | |

Scenario: Notification handling
Given user "participant1" creates room "room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "room" with 200 (v4)
# Join and leave to clear the invite notification
Given user "participant2" joins room "room" with 200 (v4)
And user "participant2" sends message "Message 1" to room "room" with 201
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 | [] | |
Then user "participant2" has the following notifications
And user "participant1" edits message "Message 1" in room "room" to "Message 1 - Edit @participant2" 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 {mention-user1} | {"mention-user1":{"type":"user","id":"participant2","name":"participant2-displayname"}} | |
Then user "participant2" has the following notifications
| app | object_type | object_id | subject |
| spreed | chat | room/Message 1 - Edit {mention-user1} | participant1-displayname mentioned you in a private conversation |
And user "participant1" edits message "Message 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 | [] | |
Then user "participant2" has the following notifications

0 comments on commit 62c3f13

Please sign in to comment.