-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4581 from LibreSign/chore/tests-improvement
chore: tests improvement
- Loading branch information
Showing
1 changed file
with
24 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 | ||
|
@@ -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" | ||
|