test(api): split search user tests

This commit is contained in:
Saw-jan
2024-04-03 14:33:14 +05:45
parent 43abf34be8
commit e0364e8bbe
3 changed files with 462 additions and 152 deletions
@@ -21,7 +21,6 @@ Feature: get users
"required": [
"displayName",
"id",
"mail",
"onPremisesSamAccountName",
"accountEnabled",
"userType"
@@ -35,10 +34,6 @@ Feature: get users
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["brian@example.org"]
},
"onPremisesSamAccountName": {
"type": "string",
"enum": ["Brian"]
@@ -1378,56 +1373,6 @@ Feature: get users
}
"""
@env-config
Scenario: non-admin user searches other users by display name (OCIS_SHOW_USER_EMAIL_IN_RESULTS enabled)
Given the config "OCIS_SHOW_USER_EMAIL_IN_RESULTS" has been set to "true"
When user "Brian" searches for user "ali" using Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
"id",
"mail",
"userType"
],
"properties": {
"displayName": {
"type": "string",
"enum": ["Alice Hansen"]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["alice@example.org"]
},
"userType": {
"type": "string",
"enum": ["Member"]
}
}
}
}
}
}
"""
Scenario: non-admin user tries to search for a user by display name with less than 3 characters
When user "Brian" tries to search for user "al" using Graph API
Then the HTTP status code should be "403"