Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: tests improvement #4581

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions tests/integration/features/identify-account/search.feature
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Feature: search
Background: Create users
Given user "search-signer1" exists
Given user "search-signer2" exists

Scenario: Search account by specific user
Given as user "admin"
And user "search-signer1" exists
And user "search-signer2" exists
When sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=search-signer1"
Then the response should have a status code 200
And the response should be a JSON array with the following mandatory values
Expand All @@ -19,6 +17,8 @@ Feature: search

Scenario: Search account by multiple users
Given as user "admin"
And user "search-signer1" exists
And user "search-signer2" exists
When sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=search-signer"
Then the response should have a status code 200
And the response should be a JSON array with the following mandatory values
Expand All @@ -40,32 +40,37 @@ Feature: search

Scenario: Search account by herself with partial name search
Given as user "admin"
And set the email of user "admin" to "[email protected]"
When sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=adm"
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods"
| value | (string)[{"name":"account","enabled":true}] |
And user "can-find-myself" exists
And run the command "group:adduser admin can-find-myself" with result code 0
And set the email of user "can-find-myself" to "[email protected]"
When sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=can-"
Then the response should have a status code 200
And the response should be a JSON array with the following mandatory values
| key | value |
| (jq).ocs.data\|length | 1 |
| (jq).ocs.data[0].id | admin |
| (jq).ocs.data[0].isNoUser | false |
| (jq).ocs.data[0].displayName | admin |
| (jq).ocs.data[0].subname | admin@email.tld |
| (jq).ocs.data[0].icon | icon-user |
| (jq).ocs.data[0].shareType | 0 |
| key | value |
| (jq).ocs.data\|length | 1 |
| (jq).ocs.data[0].id | can-find-myself |
| (jq).ocs.data[0].isNoUser | false |
| (jq).ocs.data[0].displayName | can-find-myself-displayname |
| (jq).ocs.data[0].subname | my@email.tld |
| (jq).ocs.data[0].icon | icon-user |
| (jq).ocs.data[0].shareType | 0 |

Scenario: Search account by herself without permission to identify by account
Given as user "admin"
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods"
| value | (string)[{"name":"email","enabled":true}] |
And set the display name of user "admin" to "Temporary Name"
And set the email of user "admin" to "[email protected]"
And sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=admin"
Given user "cant-find-myself" exists
And run the command "group:adduser admin cant-find-myself" with result code 0
And set the display name of user "cant-find-myself" to "Temporary Name"
And set the email of user "cant-find-myself" to "[email protected]"
When as user "cant-find-myself"
And sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=cant-find-myself"
Then the response should have a status code 200
And the response should be a JSON array with the following mandatory values
| key | value |
| (jq).ocs.data\|length | 0 |
And set the email of user "admin" to "[email protected]"
And set the display name of user "admin" to "admin"

Scenario: Search account by herself with permission to identify by account
Given as user "admin"
Expand Down
Loading