diff options
author | Joas Schilling <coding@schilljs.com> | 2021-03-03 14:08:56 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-03-08 13:56:19 +0300 |
commit | 5bff56f2cac21c1964e6f81be00d22e261d2d926 (patch) | |
tree | b6d42dfce763b419a17c29f680636f9148ce8caa /tests | |
parent | 6902e5705705ea9a9147670469c1767a4bd8a443 (diff) |
Move listed rooms to API v4
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
5 files changed, 62 insertions, 62 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index f46ebfb2d..4c0bb0870 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -139,59 +139,59 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** - * @Then /^user "([^"]*)" cannot find any listed rooms(?: \((v3)\))?$/ + * @Then /^user "([^"]*)" cannot find any listed rooms \((v4)\)$/ * * @param string $user * @param string $apiVersion */ - public function userCannotFindAnyListedRooms($user, $apiVersion = 'v3') { + public function userCannotFindAnyListedRooms(string $user, string $apiVersion) { $this->userCanFindListedRoomsWithTerm($user, '', $apiVersion, null); } /** - * @Then /^user "([^"]*)" cannot find any listed rooms with (\d+)(?: \((v3)\))?$/ + * @Then /^user "([^"]*)" cannot find any listed rooms with (\d+) \((v4)\)$/ * * @param string $user * @param int $statusCode * @param string $apiVersion */ - public function userCannotFindAnyListedRoomsWithStatus($user, $statusCode, $apiVersion = 'v3') { + public function userCannotFindAnyListedRoomsWithStatus(string $user, int $statusCode, string $apiVersion) { $this->setCurrentUser($user); $this->sendRequest('GET', '/apps/spreed/api/' . $apiVersion . '/listed-room'); $this->assertStatusCode($this->response, $statusCode); } /** - * @Then /^user "([^"]*)" cannot find any listed rooms with term "([^"]*)"(?: \((v3)\))?$/ + * @Then /^user "([^"]*)" cannot find any listed rooms with term "([^"]*)" \((v4)\)$/ * * @param string $user * @param string $term * @param string $apiVersion */ - public function userCannotFindAnyListedRoomsWithTerm($user, $term, $apiVersion = 'v3') { + public function userCannotFindAnyListedRoomsWithTerm(string $user, string $term, string $apiVersion) { $this->userCanFindListedRoomsWithTerm($user, $term, $apiVersion, null); } /** - * @Then /^user "([^"]*)" can find listed rooms(?: \((v3)\))?$/ + * @Then /^user "([^"]*)" can find listed rooms \((v4)\)$/ * * @param string $user * @param string $apiVersion * @param TableNode|null $formData */ - public function userCanFindListedRooms($user, $apiVersion = 'v3', TableNode $formData = null) { + public function userCanFindListedRooms(string $user, string $apiVersion, TableNode $formData = null) { $this->userCanFindListedRoomsWithTerm($user, '', $apiVersion, $formData); } /** - * @Then /^user "([^"]*)" can find listed rooms with term "([^"]*)"(?: \((v3)\))?$/ + * @Then /^user "([^"]*)" can find listed rooms with term "([^"]*)" \((v4)\)$/ * * @param string $user * @param string $term * @param string $apiVersion * @param TableNode|null $formData */ - public function userCanFindListedRoomsWithTerm($user, $term, $apiVersion = 'v3', TableNode $formData = null) { + public function userCanFindListedRoomsWithTerm(string $user, string $term, string $apiVersion, TableNode $formData = null) { $this->setCurrentUser($user); $suffix = ''; if ($term !== '') { @@ -921,15 +921,15 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** - * @Then /^user "([^"]*)" allows listing room "([^"]*)" for "(none|users|all|\d+)" with (\d+)(?: \((v3)\))?$/ + * @Then /^user "([^"]*)" allows listing room "([^"]*)" for "(none|users|all|\d+)" with (\d+) \((v4)\)$/ * * @param string $user - * @param string $newState * @param string $identifier - * @param string $statusCode + * @param string|int $newState + * @param int $statusCode * @param string $apiVersion */ - public function userChangesListableScopeOfTheRoom($user, $identifier, $newState, $statusCode, $apiVersion = 'v3') { + public function userChangesListableScopeOfTheRoom(string $user, string $identifier, $newState, int $statusCode, string $apiVersion) { $this->setCurrentUser($user); if ($newState === 'none') { $newStateValue = 0; // Room::LISTABLE_NONE diff --git a/tests/integration/features/chat/system-messages.feature b/tests/integration/features/chat/system-messages.feature index 453b52c1e..3e72d3ff4 100644 --- a/tests/integration/features/chat/system-messages.feature +++ b/tests/integration/features/chat/system-messages.feature @@ -164,7 +164,7 @@ Feature: System messages Given user "participant1" creates room "room" | roomType | 2 | | roomName | room | - And user "participant1" allows listing room "room" for "all" with 200 + And user "participant1" allows listing room "room" for "all" with 200 (v4) When user "participant2" joins room "room" with 200 Then user "participant1" sees the following system messages in room "room" with 200 | room | actorType | actorId | actorDisplayName | systemMessage | @@ -216,9 +216,9 @@ Feature: System messages | roomType | 2 | | roomName | room | And user "participant1" adds "participant2" to room "room" with 200 - When user "participant1" allows listing room "room" for "all" with 200 - And user "participant1" allows listing room "room" for "users" with 200 - And user "participant1" allows listing room "room" for "none" with 200 + When user "participant1" allows listing room "room" for "all" with 200 (v4) + And user "participant1" allows listing room "room" for "users" with 200 (v4) + And user "participant1" allows listing room "room" for "none" with 200 (v4) Then user "participant1" sees the following system messages in room "room" with 200 | room | actorType | actorId | actorDisplayName | systemMessage | | room | users | participant1 | participant1-displayname | listable_none | diff --git a/tests/integration/features/conversation/find-listed.feature b/tests/integration/features/conversation/find-listed.feature index 8f48de576..3784bb399 100644 --- a/tests/integration/features/conversation/find-listed.feature +++ b/tests/integration/features/conversation/find-listed.feature @@ -12,9 +12,9 @@ Feature: conversation/find-listed And user "creator" creates room "public-room" | roomType | 3 | | roomName | public-room | - When user "creator" allows listing room "group-room" for "none" with 200 - And user "creator" allows listing room "public-room" for "none" with 200 - Then user "<user>" cannot find any listed rooms (v3) + When user "creator" allows listing room "group-room" for "none" with 200 (v4) + And user "creator" allows listing room "public-room" for "none" with 200 (v4) + Then user "<user>" cannot find any listed rooms (v4) Examples: | user | | creator | @@ -28,13 +28,13 @@ Feature: conversation/find-listed And user "creator" creates room "public-room" | roomType | 3 | | roomName | public-room | - When user "creator" allows listing room "group-room" for "users" with 200 - And user "creator" allows listing room "public-room" for "users" with 200 - Then user "regular-user" can find listed rooms (v3) + When user "creator" allows listing room "group-room" for "users" with 200 (v4) + And user "creator" allows listing room "public-room" for "users" with 200 (v4) + Then user "regular-user" can find listed rooms (v4) | name | listable | | group-room | 1 | | public-room | 1 | - And user "user-guest@example.com" cannot find any listed rooms (v3) + And user "user-guest@example.com" cannot find any listed rooms (v4) Scenario: All users can find all-listed rooms Given user "creator" creates room "group-room" @@ -43,13 +43,13 @@ Feature: conversation/find-listed And user "creator" creates room "public-room" | roomType | 3 | | roomName | public-room | - When user "creator" allows listing room "group-room" for "all" with 200 - And user "creator" allows listing room "public-room" for "all" with 200 - Then user "regular-user" can find listed rooms (v3) + When user "creator" allows listing room "group-room" for "all" with 200 (v4) + And user "creator" allows listing room "public-room" for "all" with 200 (v4) + Then user "regular-user" can find listed rooms (v4) | name | listable | | group-room | 2 | | public-room | 2 | - And user "user-guest@example.com" can find listed rooms (v3) + And user "user-guest@example.com" can find listed rooms (v4) | name | listable | | group-room | 2 | | public-room | 2 | @@ -61,11 +61,11 @@ Feature: conversation/find-listed And user "creator" creates room "public-room" | roomType | 3 | | roomName | public-room | - And user "creator" allows listing room "group-room" for "users" with 200 - And user "creator" allows listing room "public-room" for "users" with 200 + And user "creator" allows listing room "group-room" for "users" with 200 (v4) + And user "creator" allows listing room "public-room" for "users" with 200 (v4) When user "regular-user" joins room "group-room" with 200 And user "regular-user" joins room "public-room" with 200 - Then user "regular-user" cannot find any listed rooms (v3) + Then user "regular-user" cannot find any listed rooms (v4) Scenario: Participants cannot search for already joined listed rooms Given user "creator" creates room "group-room" @@ -74,11 +74,11 @@ Feature: conversation/find-listed And user "creator" creates room "public-room" | roomType | 3 | | roomName | public-room | - And user "creator" allows listing room "group-room" for "users" with 200 - And user "creator" allows listing room "public-room" for "users" with 200 + And user "creator" allows listing room "group-room" for "users" with 200 (v4) + And user "creator" allows listing room "public-room" for "users" with 200 (v4) When user "regular-user" joins room "group-room" with 200 And user "regular-user" joins room "public-room" with 200 - Then user "regular-user" cannot find any listed rooms (v3) + Then user "regular-user" cannot find any listed rooms (v4) Scenario: Users can use search terms to find listed rooms Given user "creator" creates room "group-room" @@ -93,15 +93,15 @@ Feature: conversation/find-listed And user "creator" creates room "public-the-cool-room" | roomType | 3 | | roomName | public-the-cool-room | - When user "creator" allows listing room "group-room" for "all" with 200 - And user "creator" allows listing room "public-room" for "all" with 200 - And user "creator" allows listing room "group-the-cool-room" for "all" with 200 - And user "creator" allows listing room "public-the-cool-room" for "all" with 200 - Then user "regular-user" can find listed rooms with term "cool" (v3) + When user "creator" allows listing room "group-room" for "all" with 200 (v4) + And user "creator" allows listing room "public-room" for "all" with 200 (v4) + And user "creator" allows listing room "group-the-cool-room" for "all" with 200 (v4) + And user "creator" allows listing room "public-the-cool-room" for "all" with 200 (v4) + Then user "regular-user" can find listed rooms with term "cool" (v4) | name | listable | | group-the-cool-room | 2 | | public-the-cool-room | 2 | - And user "user-guest@example.com" can find listed rooms with term "cool" (v3) + And user "user-guest@example.com" can find listed rooms with term "cool" (v4) | name | listable | | group-the-cool-room | 2 | | public-the-cool-room | 2 | @@ -110,9 +110,9 @@ Feature: conversation/find-listed Given user "creator" creates room "group-room" | roomType | 2 | | roomName | group-room | - When user "creator" allows listing room "group-room" for "all" with 200 - Then user "regular-user" cannot find any listed rooms with term "cool" (v3) - And user "user-guest@example.com" cannot find any listed rooms with term "cool" (v3) + When user "creator" allows listing room "group-room" for "all" with 200 (v4) + Then user "regular-user" cannot find any listed rooms with term "cool" (v4) + And user "user-guest@example.com" cannot find any listed rooms with term "cool" (v4) Scenario: Guest users without accounts cannot search for listed rooms Given user "creator" creates room "public-room" @@ -121,6 +121,6 @@ Feature: conversation/find-listed And user "creator" creates room "public-room-listed" | roomType | 3 | | roomName | public-room-listed | - And user "creator" allows listing room "public-room-listed" for "all" with 200 + And user "creator" allows listing room "public-room-listed" for "all" with 200 (v4) When user "guest" joins room "public-room" with 200 - Then user "guest" cannot find any listed rooms with 401 (v3) + Then user "guest" cannot find any listed rooms with 401 (v4) diff --git a/tests/integration/features/conversation/join-listable.feature b/tests/integration/features/conversation/join-listable.feature index ef7d713e0..d79fb460e 100644 --- a/tests/integration/features/conversation/join-listable.feature +++ b/tests/integration/features/conversation/join-listable.feature @@ -13,7 +13,7 @@ Feature: conversation/join-listable Given user "creator" creates room "room" | roomType | 2 | | roomName | room | - When user "creator" allows listing room "room" for "none" with 200 + When user "creator" allows listing room "room" for "none" with 200 (v4) Then user "regular-user" joins room "room" with 404 And user "user-guest@example.com" joins room "room" with 404 And user "guest" joins room "room" with 404 @@ -22,7 +22,7 @@ Feature: conversation/join-listable Given user "creator" creates room "room" | roomType | 3 | | roomName | room | - And user "creator" allows listing room "room" for "none" with 200 + And user "creator" allows listing room "room" for "none" with 200 (v4) When user "regular-user" joins room "room" with 200 And user "user-guest@example.com" joins room "room" with 200 And user "guest" joins room "room" with 200 @@ -40,7 +40,7 @@ Feature: conversation/join-listable Given user "creator" creates room "room" | roomType | 2 | | roomName | room | - And user "creator" allows listing room "room" for "users" with 200 + And user "creator" allows listing room "room" for "users" with 200 (v4) When user "regular-user" joins room "room" with 200 And user "user-guest@example.com" joins room "room" with 404 And user "guest" joins room "room" with 404 @@ -53,7 +53,7 @@ Feature: conversation/join-listable Given user "creator" creates room "room" | roomType | 3 | | roomName | room | - And user "creator" allows listing room "room" for "users" with 200 + And user "creator" allows listing room "room" for "users" with 200 (v4) When user "regular-user" joins room "room" with 200 And user "user-guest@example.com" joins room "room" with 200 And user "guest" joins room "room" with 200 @@ -71,7 +71,7 @@ Feature: conversation/join-listable Given user "creator" creates room "room" | roomType | 2 | | roomName | room | - And user "creator" allows listing room "room" for "all" with 200 + And user "creator" allows listing room "room" for "all" with 200 (v4) When user "regular-user" joins room "room" with 200 And user "user-guest@example.com" joins room "room" with 200 And user "guest" joins room "room" with 404 @@ -85,7 +85,7 @@ Feature: conversation/join-listable Given user "creator" creates room "room" | roomType | 3 | | roomName | room | - And user "creator" allows listing room "room" for "all" with 200 + And user "creator" allows listing room "room" for "all" with 200 (v4) When user "regular-user" joins room "room" with 200 And user "user-guest@example.com" joins room "room" with 200 And user "guest" joins room "room" with 200 diff --git a/tests/integration/features/conversation/set-listable.feature b/tests/integration/features/conversation/set-listable.feature index 869c91686..710565bdf 100644 --- a/tests/integration/features/conversation/set-listable.feature +++ b/tests/integration/features/conversation/set-listable.feature @@ -7,7 +7,7 @@ Feature: conversation/set-listable Given user "creator" creates room "room" | roomType | 2 | | roomName | room | - When user "creator" allows listing room "room" for "<listable>" with 200 + When user "creator" allows listing room "room" for "<listable>" with 200 (v4) Then user "creator" is participant of the following rooms (v3) | id | type | listable | | room | 2 | <listable> | @@ -21,7 +21,7 @@ Feature: conversation/set-listable Given user "creator" creates room "room" | roomType | 2 | | roomName | room | - Then user "creator" allows listing room "room" for "5" with 400 + Then user "creator" allows listing room "room" for "5" with 400 (v4) Scenario: Only moderators and owners can change listable attribute Given user "creator" creates room "room" @@ -32,21 +32,21 @@ Feature: conversation/set-listable And user "user-guest@example.com" is a guest account user And user "creator" adds "regular-user" to room "room" with 200 And user "creator" adds "moderator" to room "room" with 200 - And user "creator" allows listing room "room" for "all" with 200 + And user "creator" allows listing room "room" for "all" with 200 (v4) When user "creator" promotes "moderator" in room "room" with 200 And user "user-guest@example.com" joins room "room" with 200 And user "guest" joins room "room" with 200 - Then user "moderator" allows listing room "room" for "none" with 200 - And user "regular-user" allows listing room "room" for "users" with 403 - And user "user-guest@example.com" allows listing room "room" for "users" with 403 - And user "guest" allows listing room "room" for "users" with 401 + Then user "moderator" allows listing room "room" for "none" with 200 (v4) + And user "regular-user" allows listing room "room" for "users" with 403 (v4) + And user "user-guest@example.com" allows listing room "room" for "users" with 403 (v4) + And user "guest" allows listing room "room" for "users" with 401 (v4) Scenario: Cannot change listable attribute of one to one conversations Given user "creator" creates room "room" | roomType | 1 | | invite | regular-user | - Then user "creator" allows listing room "room" for "all" with 400 - And user "regular-user" allows listing room "room" for "all" with 400 + Then user "creator" allows listing room "room" for "all" with 400 (v4) + And user "regular-user" allows listing room "room" for "all" with 400 (v4) Scenario: Cannot change listable attribute on a file conversation Given user "creator" logs in @@ -54,4 +54,4 @@ Feature: conversation/set-listable And user "regular-user" accepts last share When user "creator" gets the room for path "welcome.txt" with 200 And user "creator" joins room "file welcome.txt room" with 200 - Then user "creator" allows listing room "file welcome.txt room" for "all" with 403 + Then user "creator" allows listing room "file welcome.txt room" for "all" with 403 (v4) |