diff options
author | Vitor Mattos <vitor@php.rio> | 2021-12-03 13:15:08 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-01-21 14:23:15 +0300 |
commit | e0bf19f6626d9b9e6cbd9ebfa2fae95faba3130b (patch) | |
tree | 54f1ad1b97841697cdd20b0227cb12d41465eda3 /tests | |
parent | c756413574a9dfc86770e166cdd50b838ef89be4 (diff) |
Integration test for check share restrictions on one to one conversation
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'tests')
5 files changed, 26 insertions, 13 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index fbee7a073..ac4780e85 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -1749,22 +1749,23 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** - * @Given /^the following app config is set$/ + * @Given the following :appId app config is set * * @param TableNode $formData */ - public function setAppConfig(TableNode $formData): void { + public function setAppConfig(string $appId, TableNode $formData): void { $currentUser = $this->currentUser; $this->setCurrentUser('admin'); foreach ($formData->getRows() as $row) { - $this->sendRequest('POST', '/apps/provisioning_api/api/v1/config/apps/spreed/' . $row[0], [ + $this->sendRequest('POST', '/apps/provisioning_api/api/v1/config/apps/' . $appId . '/' . $row[0], [ 'value' => $row[1], ]); - $this->changedConfigs[] = $row[0]; + $this->changedConfigs[$appId][] = $row[0]; } $this->setCurrentUser($currentUser); } + /** * @Given /^guest accounts can be created$/ * @@ -1811,8 +1812,10 @@ class FeatureContext implements Context, SnippetAcceptingContext { $currentUser = $this->currentUser; $this->setCurrentUser('admin'); $this->sendRequest('DELETE', '/apps/spreedcheats/'); - foreach ($this->changedConfigs as $config) { - $this->sendRequest('DELETE', '/apps/provisioning_api/api/v1/config/apps/spreed/' . $config); + foreach ($this->changedConfigs as $appId => $configs) { + foreach ($configs as $config) { + $this->sendRequest('DELETE', '/apps/provisioning_api/api/v1/config/apps/' . $appId . '/' . $config); + } } $this->setCurrentUser($currentUser); diff --git a/tests/integration/features/conversation-2/one-to-one.feature b/tests/integration/features/conversation-2/one-to-one.feature index 2a07265ae..ab3533509 100644 --- a/tests/integration/features/conversation-2/one-to-one.feature +++ b/tests/integration/features/conversation-2/one-to-one.feature @@ -197,3 +197,13 @@ Feature: one-to-one | actorType | actorId | participantType | | users | participant1 | 1 | | users | participant2 | 1 | + + Scenario: Check share restrictions on one to one conversatio + Given the following "core" app config is set + | shareapi_restrict_user_enumeration_full_match | no | + | shareapi_allow_share_dialog_user_enumeration | yes | + | shareapi_restrict_user_enumeration_to_group | yes | + | shareapi_restrict_user_enumeration_to_phone | yes | + And user "participant1" creates room "room15" with 403 (v4) + | roomType | 1 | + | invite | participant2 |
\ No newline at end of file diff --git a/tests/integration/features/conversation-2/sip-dialin.feature b/tests/integration/features/conversation-2/sip-dialin.feature index 698766801..7fe2c92e3 100644 --- a/tests/integration/features/conversation-2/sip-dialin.feature +++ b/tests/integration/features/conversation-2/sip-dialin.feature @@ -7,7 +7,7 @@ Feature: public Given user "participant1" is member of group "group1" Scenario: SIP admin enables SIP - Given the following app config is set + Given the following "spreed" app config is set | sip_bridge_dialin_info | +49-1234-567890 | | sip_bridge_shared_secret | 1234567890abcdef | | sip_bridge_groups | ["group1"] | @@ -51,7 +51,7 @@ Feature: public | 3 | 0 | users | participant3 | | Scenario: Non-SIP admin tries to enable SIP - Given the following app config is set + Given the following "spreed" app config is set | sip_bridge_dialin_info | +49-1234-567890 | | sip_bridge_shared_secret | 1234567890abcdef | | sip_bridge_groups | ["group1"] | diff --git a/tests/integration/features/conversation/limit-creation.feature b/tests/integration/features/conversation/limit-creation.feature index 7fe65f4b1..272514eeb 100644 --- a/tests/integration/features/conversation/limit-creation.feature +++ b/tests/integration/features/conversation/limit-creation.feature @@ -6,7 +6,7 @@ Feature: public Given group "group1" exists Scenario: User can not create group conversations - Given the following app config is set + Given the following "spreed" app config is set | start_conversations | ["group1"] | Then user "participant1" creates room "room" with 403 (v4) | roomType | 2 | @@ -17,7 +17,7 @@ Feature: public | roomName | room | Scenario: User can not create public conversations - Given the following app config is set + Given the following "spreed" app config is set | start_conversations | ["group1"] | Then user "participant1" creates room "room" with 403 (v4) | roomType | 3 | @@ -28,7 +28,7 @@ Feature: public | roomName | room | Scenario: User can still do one-to-one conversations - Given the following app config is set + Given the following "spreed" app config is set | start_conversations | ["group1"] | Then user "participant1" creates room "room" with 201 (v4) | roomType | 1 | diff --git a/tests/integration/features/federation/invite.feature b/tests/integration/features/federation/invite.feature index 421f708cd..eef4bd5a0 100644 --- a/tests/integration/features/federation/invite.feature +++ b/tests/integration/features/federation/invite.feature @@ -4,7 +4,7 @@ Feature: federation/invite Given user "participant2" exists Scenario: federation is disabled - Given the following app config is set + Given the following "spreed" app config is set | federation_enabled | no | Given user "participant1" creates room "room" (v4) | roomType | 3 | @@ -15,7 +15,7 @@ Feature: federation/invite | users | participant1 | 1 | Scenario: federation is enabled - Given the following app config is set + Given the following "spreed" app config is set | federation_enabled | yes | Given user "participant1" creates room "room" (v4) | roomType | 3 | |