test(api): adjust user search tests expectation

This commit is contained in:
Saw-jan
2024-04-03 13:06:45 +05:45
parent 59fab4ae5a
commit 43abf34be8
2 changed files with 52 additions and 61 deletions

View File

@@ -15,8 +15,9 @@ Feature: edit user
| email | brian@example.com |
| password | 1234 |
@env-config
Scenario Outline: admin user can edit another user's email
Given the config "OCIS_SHOW_USER_EMAIL_IN_RESULTS" has been set to "true"
When the user "Alice" changes the email of user "Brian" to "<new-email>" using the Graph API
Then the HTTP status code should be "<http-status-code>"
And the user information of "Brian" should match this JSON schema
@@ -120,9 +121,10 @@ Feature: edit user
}
"""
@env-config
Scenario Outline: normal user should not be able to change their email address
Given the administrator has assigned the role "<user-role>" to user "Brian" using the Graph API
And the config "OCIS_SHOW_USER_EMAIL_IN_RESULTS" has been set to "true"
When the user "Brian" tries to change the email of user "Brian" to "newemail@example.com" using the Graph API
Then the HTTP status code should be "401"
And the user information of "Brian" should match this JSON schema
@@ -146,9 +148,10 @@ Feature: edit user
| User |
| User Light |
@env-config
Scenario Outline: normal user should not be able to edit another user's email
Given the administrator has assigned the role "<user-role>" to user "Brian" using the Graph API
And the config "OCIS_SHOW_USER_EMAIL_IN_RESULTS" has been set to "true"
And the user "Alice" has created a new user with the following attributes:
| userName | Carol |
| displayName | Carol King |
@@ -329,7 +332,6 @@ Feature: edit user
"required": [
"displayName",
"id",
"mail",
"onPremisesSamAccountName",
"accountEnabled"
],
@@ -342,10 +344,6 @@ Feature: edit user
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["brian@example.com"]
},
"onPremisesSamAccountName": {
"type": "string",
"enum": ["Brian"]
@@ -373,7 +371,6 @@ Feature: edit user
"required": [
"displayName",
"id",
"mail",
"onPremisesSamAccountName",
"accountEnabled"
],
@@ -386,10 +383,6 @@ Feature: edit user
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["carol@example.org"]
},
"onPremisesSamAccountName": {
"type": "string",
"enum": ["Carol"]
@@ -421,7 +414,6 @@ Feature: edit user
"required": [
"displayName",
"id",
"mail",
"onPremisesSamAccountName",
"accountEnabled"
],
@@ -434,10 +426,6 @@ Feature: edit user
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["brian@example.com"]
},
"onPremisesSamAccountName": {
"type": "string",
"enum": ["Brian"]
@@ -466,7 +454,6 @@ Feature: edit user
"required": [
"displayName",
"id",
"mail",
"onPremisesSamAccountName",
"accountEnabled"
],
@@ -479,10 +466,6 @@ Feature: edit user
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["carol@example.org"]
},
"onPremisesSamAccountName": {
"type": "string",
"enum": ["Carol"]