Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-11-20 00:49:49 +0300
committerJoas Schilling <coding@schilljs.com>2020-12-08 15:00:12 +0300
commitd4249ab552e60803f38e6361050df62d0c186b71 (patch)
tree9af900d581bd655c535ad20484b1558dd2319c58 /tests
parent2ae3abfadee103fbe46e7554413f5c76475ef8c1 (diff)
Add system message when the description of a conversation is changed
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/features/chat/system-messages.feature22
-rw-r--r--tests/integration/features/conversation/lobby.feature12
-rw-r--r--tests/php/Chat/Parser/SystemMessageTest.php16
3 files changed, 44 insertions, 6 deletions
diff --git a/tests/integration/features/chat/system-messages.feature b/tests/integration/features/chat/system-messages.feature
index 8252d56c6..22166c62a 100644
--- a/tests/integration/features/chat/system-messages.feature
+++ b/tests/integration/features/chat/system-messages.feature
@@ -25,6 +25,28 @@ Feature: System messages
| room | users | participant1 | participant1-displayname | conversation_renamed |
| room | users | participant1 | participant1-displayname | conversation_created |
+ Scenario: Set a description
+ Given user "participant1" creates room "room"
+ | roomType | 2 |
+ | roomName | room |
+ When user "participant1" sets description for room "room" to "New description" with 200
+ Then user "participant1" sees the following system messages in room "room" with 200
+ | room | actorType | actorId | actorDisplayName | systemMessage |
+ | room | users | participant1 | participant1-displayname | description_set |
+ | room | users | participant1 | participant1-displayname | conversation_created |
+
+ Scenario: Removes a description
+ Given user "participant1" creates room "room"
+ | roomType | 2 |
+ | roomName | room |
+ And user "participant1" sets description for room "room" to "New description" with 200
+ When user "participant1" sets description for room "room" to "" with 200
+ Then user "participant1" sees the following system messages in room "room" with 200
+ | room | actorType | actorId | actorDisplayName | systemMessage |
+ | room | users | participant1 | participant1-displayname | description_removed |
+ | room | users | participant1 | participant1-displayname | description_set |
+ | room | users | participant1 | participant1-displayname | conversation_created |
+
Scenario: Toggle guests
Given user "participant1" creates room "room"
| roomType | 2 |
diff --git a/tests/integration/features/conversation/lobby.feature b/tests/integration/features/conversation/lobby.feature
index 5434ad0c9..5adba5f7a 100644
--- a/tests/integration/features/conversation/lobby.feature
+++ b/tests/integration/features/conversation/lobby.feature
@@ -232,11 +232,11 @@ Feature: conversation/lobby
And user "participant1" sends message "Message 1" to room "room" with 201
And user "participant1" sets description for room "room" to "the description" with 200
Then user "participant1" is participant of room "room" (v3)
- | name | description | type | participantType | lastMessage |
- | room | the description | 3 | 1 | Message 1 |
+ | name | description | type | participantType | lastMessage |
+ | room | the description | 3 | 1 | You set the description to "the description" |
And user "participant2" is participant of room "room" (v3)
- | name | description | type | participantType | lastMessage |
- | room | the description | 3 | 2 | Message 1 |
+ | name | description | type | participantType | lastMessage |
+ | room | the description | 3 | 2 | {actor} set the description to "the description" |
And user "participant3" is participant of room "room" (v3)
| name | description | type | participantType | lastMessage |
| room | the description | 3 | 3 | |
@@ -244,8 +244,8 @@ Feature: conversation/lobby
| name | description | type | participantType | lastMessage |
| room | the description | 3 | 5 | |
And user "guest" is participant of room "room" (v3)
- | name | description | type | participantType | lastMessage |
- | room | the description | 3 | 6 | Message 1 |
+ | name | description | type | participantType | lastMessage |
+ | room | the description | 3 | 6 | {actor} set the description to "the description" |
And user "guest2" is participant of room "room" (v3)
| name | description | type | participantType | lastMessage |
| room | the description | 3 | 4 | |
diff --git a/tests/php/Chat/Parser/SystemMessageTest.php b/tests/php/Chat/Parser/SystemMessageTest.php
index 96c679b0e..e23e1fb5a 100644
--- a/tests/php/Chat/Parser/SystemMessageTest.php
+++ b/tests/php/Chat/Parser/SystemMessageTest.php
@@ -137,6 +137,22 @@ class SystemMessageTest extends TestCase {
'You renamed the conversation from "old" to "new"',
['actor' => ['id' => 'actor', 'type' => 'user']],
],
+ ['description_set', ['newDescription' => 'New description'], 'recipient',
+ '{actor} set the description to "New description"',
+ ['actor' => ['id' => 'actor', 'type' => 'user']],
+ ],
+ ['description_set', ['newDescription' => 'New description'], 'actor',
+ 'You set the description to "New description"',
+ ['actor' => ['id' => 'actor', 'type' => 'user']],
+ ],
+ ['description_removed', [], 'recipient',
+ '{actor} removed the description',
+ ['actor' => ['id' => 'actor', 'type' => 'user']],
+ ],
+ ['description_removed', [], 'actor',
+ 'You removed the description',
+ ['actor' => ['id' => 'actor', 'type' => 'user']],
+ ],
['call_started', [], 'recipient',
'{actor} started a call',
['actor' => ['id' => 'actor', 'type' => 'user']],