Skip to content

Commit

Permalink
adding tests for searching user as a normal user
Browse files Browse the repository at this point in the history
  • Loading branch information
nirajacharya2 committed Jan 19, 2024
1 parent c5f7681 commit 174d4b8
Showing 1 changed file with 136 additions and 0 deletions.
136 changes: 136 additions & 0 deletions tests/acceptance/features/apiGraph/getUser.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1443,3 +1443,139 @@ Feature: get users
| user | errorToken |
| Alice-From-Wonderland | -From-Wonderland |
| Alice@From@Wonderland | @From@Wonderland |

@issue-7990
Scenario: non-admin user searches other users by e-mail
When user "Brian" searches for user "%[email protected]%22" 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",
"required": [
"displayName",
"id",
"mail",
"userType"
],
"properties": {
"displayName": {
"type": "string",
"enum": ["Alice Hansen"]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["[email protected]"]
},
"userType": {
"type": "string",
"enum": ["Member"]
}
}
}
}
}
"""

@issue-7990
Scenario: non-admin user searches for a disabled users
Given the user "Admin" has disabled user "Alice" using the Graph API
When user "Brian" searches for user "alice" 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",
"required": [
"displayName",
"id",
"mail",
"userType"
],
"properties": {
"displayName": {
"type": "string",
"enum": ["Alice Hansen"]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["[email protected]"]
},
"userType": {
"type": "string",
"enum": ["Member"]
}
}
}
}
}
"""

@issue-7990
Scenario: non-admin user searches for multiple users having same displayname
Given the user "Alice" has created a new user with the following attributes:
| userName | SameDisplayName |
| displayName | Alice Hansen |
| email | alice@example.de |
| password | containsCharacters(*:!;_+-&) |

When user "Brian" searches for user "%[email protected]%22" 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",
"required": [
"displayName",
"id",
"mail",
"userType"
],
"properties": {
"displayName": {
"type": "string",
"enum": ["Alice Hansen"]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"type": "string",
"enum": ["[email protected]"]
},
"userType": {
"type": "string",
"enum": ["Member"]
}
}
}
}
}
"""

0 comments on commit 174d4b8

Please sign in to comment.