diff options
author | Joas Schilling <coding@schilljs.com> | 2022-03-11 17:16:27 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-03-11 17:16:27 +0300 |
commit | 4a6f5bd20a2ccecd071bc9111939a6d192d1cdd4 (patch) | |
tree | f29868c2028832a7b9de3e89fe0521036a129b96 /tests | |
parent | 8fccd5376a1ca1997aaf98fe9a7382e85fb62108 (diff) |
Add a test for the system messages of reactionsfeature/6971/change-returns-of-reaction-api
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/features/bootstrap/FeatureContext.php | 3 | ||||
-rw-r--r-- | tests/integration/features/reaction/react.feature | 22 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 8eef8944f..90f9d5e08 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -1673,6 +1673,9 @@ class FeatureContext implements Context, SnippetAcceptingContext { return $message['systemMessage'] !== ''; }); + // Fix index gaps after the array_filter above + $messages = array_values($messages); + foreach ($messages as $systemMessage) { // Include the received system messages in the list of messages used // for replies. diff --git a/tests/integration/features/reaction/react.feature b/tests/integration/features/reaction/react.feature index 15a970708..7dcfa52aa 100644 --- a/tests/integration/features/reaction/react.feature +++ b/tests/integration/features/reaction/react.feature @@ -12,6 +12,11 @@ Feature: reaction/react And user "participant2" react with "👍" on message "Message 1" to room "room" with 201 | actorType | actorId | actorDisplayName | reaction | | users | participant2 | participant2-displayname | 👍 | + Then user "participant1" sees the following system messages in room "room" with 200 + | room | actorType | actorId | actorDisplayName | systemMessage | + | room | users | participant2 | participant2-displayname | reaction | + | room | users | participant1 | participant1-displayname | user_added | + | room | users | participant1 | participant1-displayname | conversation_created | Then user "participant1" sees the following messages in room "room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | reactions | | room | users | participant1 | participant1-displayname | Message 1 | [] | {"👍":1} | @@ -22,6 +27,12 @@ Feature: reaction/react Then user "participant1" sees the following messages in room "room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | reactions | | room | users | participant1 | participant1-displayname | Message 1 | [] | {"👍":2} | + Then user "participant1" sees the following system messages in room "room" with 200 + | room | actorType | actorId | actorDisplayName | systemMessage | + | room | users | participant1 | participant1-displayname | reaction | + | room | users | participant2 | participant2-displayname | reaction | + | room | users | participant1 | participant1-displayname | user_added | + | room | users | participant1 | participant1-displayname | conversation_created | Scenario: React two times to same message with the same reaction Given user "participant1" creates room "room" (v4) @@ -38,6 +49,11 @@ Feature: reaction/react Then user "participant1" sees the following messages in room "room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | reactions | | room | users | participant1 | participant1-displayname | Message 1 | [] | {"👍":1} | + Then user "participant1" sees the following system messages in room "room" with 200 + | room | actorType | actorId | actorDisplayName | systemMessage | + | room | users | participant2 | participant2-displayname | reaction | + | room | users | participant1 | participant1-displayname | user_added | + | room | users | participant1 | participant1-displayname | conversation_created | Scenario: Delete reaction to message with success Given user "participant1" creates room "room" (v4) @@ -56,6 +72,12 @@ Feature: reaction/react Then user "participant1" sees the following messages in room "room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | reactions | | room | users | participant1 | participant1-displayname | Message 1 | [] | [] | + Then user "participant1" sees the following system messages in room "room" with 200 + | room | actorType | actorId | actorDisplayName | systemMessage | + | room | users | participant2 | participant2-displayname | reaction_revoked | + | room | users | participant2 | participant2-displayname | reaction_deleted | + | room | users | participant1 | participant1-displayname | user_added | + | room | users | participant1 | participant1-displayname | conversation_created | Scenario: Retrieve reactions of a message Given user "participant1" creates room "room" (v4) |