summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-01-25 13:14:52 +0100
committerJoas Schilling <coding@schilljs.com>2023-01-25 16:17:58 +0100
commitcf72ae74df6ef1ae5e424a404546dea783e49e53 (patch)
tree5ad0cffd9e3b922d68140d4c060550a910be4b3c /tests
parentfac1de205e34905b1cfae41c47b9660af5c39ba9 (diff)
Introduce a "former one-to-one" conversation type
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/features/bootstrap/FeatureContext.php4
-rw-r--r--tests/integration/features/command/user-remove.feature13
-rw-r--r--tests/integration/features/conversation/delete-user.feature14
-rw-r--r--tests/php/Service/RoomServiceTest.php3
4 files changed, 24 insertions, 10 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php
index 91893ae3b..718c02e06 100644
--- a/tests/integration/features/bootstrap/FeatureContext.php
+++ b/tests/integration/features/bootstrap/FeatureContext.php
@@ -150,7 +150,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
self::$identifierToToken = [];
self::$identifierToId = [];
self::$tokenToIdentifier = [];
- self::$sessionIdToUser = [];
+ self::$sessionIdToUser = [
+ 'cli' => 'cli',
+ ];
self::$userToSessionId = [];
self::$userToAttendeeId = [];
self::$textToMessageId = [];
diff --git a/tests/integration/features/command/user-remove.feature b/tests/integration/features/command/user-remove.feature
index 843468a60..568510ca6 100644
--- a/tests/integration/features/command/user-remove.feature
+++ b/tests/integration/features/command/user-remove.feature
@@ -12,14 +12,18 @@ Feature: command/user-remove
| roomType | 3 |
| roomName | room |
And user "participant1" adds user "participant2" to room "room2" with 200 (v4)
+ And user "participant1" is participant of the following unordered rooms (v4)
+ | id | name | type | participantType | readOnly |
+ | room1 | participant2 | 1 | 1 | 0 |
+ | room2 | room | 3 | 1 | 0 |
And invoking occ with "talk:user:remove --user participant2"
And the command output contains the text "Users successfully removed from all rooms"
Then the command was successful
And user "participant2" is participant of the following rooms (v4)
And user "participant1" is participant of the following unordered rooms (v4)
- | id | name | type | participantType |
- | room1 | participant2-displayname | 2 | 1 |
- | room2 | room | 3 | 1 |
+ | id | name | type | participantType | readOnly |
+ | room1 | participant2-displayname | 5 | 1 | 1 |
+ | room2 | room | 3 | 1 | 0 |
And user "participant1" sees the following attendees in room "room1" with 200 (v4)
| actorType | actorId | participantType |
| users | participant1 | 1 |
@@ -41,9 +45,10 @@ Feature: command/user-remove
And user "participant2" is participant of the following rooms (v4)
And user "participant1" is participant of the following rooms (v4)
| id | name | type | participantType |
- | room | participant2-displayname | 2 | 1 |
+ | room | participant2-displayname | 5 | 1 |
Then user "participant1" sees the following system messages in room "room" with 200
| room | actorType | actorId | systemMessage | message | messageParameters |
+ | room | guests | cli | read_only | An administrator locked the conversation | {"actor":{"type":"guest","id":"guest\/cli","name":"Guest"}} |
| room | users | participant1 | call_tried | You tried to call {user} | {"user":{"type":"highlight","id":"deleted_user","name":"participant2-displayname"}} |
| room | users | participant1 | call_left | You left the call | {"actor":{"type":"user","id":"participant1","name":"participant1-displayname"}} |
| room | users | participant1 | call_started | You started a call | {"actor":{"type":"user","id":"participant1","name":"participant1-displayname"}} |
diff --git a/tests/integration/features/conversation/delete-user.feature b/tests/integration/features/conversation/delete-user.feature
index 8b3a7ad9f..fcc2f3467 100644
--- a/tests/integration/features/conversation/delete-user.feature
+++ b/tests/integration/features/conversation/delete-user.feature
@@ -12,27 +12,33 @@ Feature: conversation/delete-user
| roomType | 1 |
| invite | participant2 |
And user "participant2" sends message "Message 1" to room "one-to-one room" with 201
+ Then user "participant1" is participant of the following rooms (v4)
+ | name | type | readOnly |
+ | participant2 | 1 | 0 |
When user "participant2" is deleted
Then user "participant1" sees the following messages in room "one-to-one room" with 200
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| one-to-one room | deleted_users | deleted_users | | Message 1 | [] |
Then user "participant1" is participant of the following rooms (v4)
- | name | type |
- | participant2-displayname | 2 |
+ | name | type | readOnly |
+ | participant2-displayname | 5 | 1 |
Scenario: delete user who left a one-to-one room
Given user "participant1" creates room "one-to-one room" (v4)
| roomType | 1 |
| invite | participant2 |
And user "participant2" sends message "Message 1" to room "one-to-one room" with 201
+ Then user "participant1" is participant of the following rooms (v4)
+ | name | type | readOnly |
+ | participant2 | 1 | 0 |
When user "participant2" leaves room "one-to-one room" with 200 (v4)
When user "participant2" is deleted
Then user "participant1" sees the following messages in room "one-to-one room" with 200
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| one-to-one room | deleted_users | deleted_users | | Message 1 | [] |
Then user "participant1" is participant of the following rooms (v4)
- | name | type |
- | participant2-displayname | 2 |
+ | name | type | readOnly |
+ | participant2-displayname | 5 | 1 |
Scenario: delete user who is in a group room
Given user "participant1" creates room "group room" (v4)
diff --git a/tests/php/Service/RoomServiceTest.php b/tests/php/Service/RoomServiceTest.php
index 7b95d08f8..a8b1fcf64 100644
--- a/tests/php/Service/RoomServiceTest.php
+++ b/tests/php/Service/RoomServiceTest.php
@@ -219,7 +219,8 @@ class RoomServiceTest extends TestCase {
return [
[Room::TYPE_ONE_TO_ONE],
[Room::TYPE_UNKNOWN],
- [5],
+ [Room::TYPE_ONE_TO_ONE_FORMER],
+ [6],
];
}