diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-01-26 17:30:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-26 17:30:47 +0100 |
commit | 910145e019ecf589745819c661bd8666e869b54e (patch) | |
tree | a0d4eb27a2e236f10d383798f6161b1a6c90599f /tests | |
parent | 2791580b84d88beb09d48835437140519be314ea (diff) | |
parent | 062ed28540c21d09a19cf7077033e1b0165658c4 (diff) |
Merge pull request #8600 from nextcloud/bugfix/8517/former-1-1-conversation-type
Introduce a "former one-to-one" conversation type
Diffstat (limited to 'tests')
5 files changed, 40 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/command/user-transfer-ownership.feature b/tests/integration/features/command/user-transfer-ownership.feature index ddf14c19b..e8a69d67e 100644 --- a/tests/integration/features/command/user-transfer-ownership.feature +++ b/tests/integration/features/command/user-transfer-ownership.feature @@ -4,11 +4,15 @@ Feature: command/user-remove Given user "participant1" exists Given user "participant2" exists Given user "participant3" exists + Given user "participant4" exists Scenario: Only transfer when moderator permissions Given user "participant1" creates room "one-to-one" (v4) | roomType | 1 | | invite | participant2 | + Given user "participant4" creates room "one-to-one former" (v4) + | roomType | 1 | + | invite | participant2 | Given user "participant1" creates room "user" (v4) | roomType | 3 | | roomName | user | @@ -25,12 +29,14 @@ Feature: command/user-remove | roomType | 3 | | roomName | self-joined | And user "participant2" joins room "self-joined" with 200 (v4) + And invoking occ with "talk:user:remove --user participant4" And invoking occ with "talk:user:transfer-ownership participant2 participant3" And the command output contains the text "Added or promoted user participant3 in 2 rooms." Then the command was successful And user "participant2" is participant of the following unordered rooms (v4) | id | name | type | participantType | | one-to-one | participant1 | 1 | 1 | + | one-to-one former | participant4-displayname | 5 | 1 | | user | user | 3 | 3 | | moderator | moderator | 2 | 2 | | owner | owner | 2 | 1 | @@ -44,6 +50,9 @@ Feature: command/user-remove Given user "participant1" creates room "one-to-one" (v4) | roomType | 1 | | invite | participant2 | + Given user "participant4" creates room "one-to-one former" (v4) + | roomType | 1 | + | invite | participant2 | Given user "participant1" creates room "user" (v4) | roomType | 3 | | roomName | user | @@ -60,12 +69,14 @@ Feature: command/user-remove | roomType | 3 | | roomName | self-joined | And user "participant2" joins room "self-joined" with 200 (v4) + And invoking occ with "talk:user:remove --user participant4" And invoking occ with "talk:user:transfer-ownership --include-non-moderator participant2 participant3" And the command output contains the text "Added or promoted user participant3 in 3 rooms." Then the command was successful And user "participant2" is participant of the following unordered rooms (v4) | id | name | type | participantType | | one-to-one | participant1 | 1 | 1 | + | one-to-one former | participant4-displayname | 5 | 1 | | user | user | 3 | 3 | | moderator | moderator | 2 | 2 | | owner | owner | 2 | 1 | @@ -80,6 +91,9 @@ Feature: command/user-remove Given user "participant1" creates room "one-to-one" (v4) | roomType | 1 | | invite | participant2 | + Given user "participant4" creates room "one-to-one former" (v4) + | roomType | 1 | + | invite | participant2 | Given user "participant1" creates room "user" (v4) | roomType | 3 | | roomName | user | @@ -96,12 +110,14 @@ Feature: command/user-remove | roomType | 3 | | roomName | self-joined | And user "participant2" joins room "self-joined" with 200 (v4) + And invoking occ with "talk:user:remove --user participant4" And invoking occ with "talk:user:transfer-ownership --remove-source-user participant2 participant3" And the command output contains the text "Added or promoted user participant3 in 2 rooms." Then the command was successful And user "participant2" is participant of the following unordered rooms (v4) | id | name | type | participantType | | one-to-one | participant1 | 1 | 1 | + | one-to-one former | participant4-displayname | 5 | 1 | | user | user | 3 | 3 | | self-joined | self-joined | 3 | 5 | And user "participant3" is participant of the following unordered rooms (v4) 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], ]; } |