Skip to content

Commit

Permalink
added test to update role to existing roles after assigned role is di…
Browse files Browse the repository at this point in the history
…sabled
  • Loading branch information
PrajwolAmatya committed Dec 13, 2024
1 parent 706ad82 commit 97814fa
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/acceptance/bootstrap/OcisConfigContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,33 @@ public function theAdministratorHasEnabledTheRole(string $role): void {
$this->setEnabledPermissionsRoles($defaultRoles);
}

/**
* @Given the administrator has enabled the following permissions roles:
*
* @param TableNode $table
*
* @return void
*/
public function theAdministratorHasEnabledTheFollowingPermissionsRoles(TableNode $table): void {
$defaultRoles = array_values(GraphHelper::DEFAULT_PERMISSIONS_ROLES);
foreach ($table->getRows() as $row) {
$roleId = GraphHelper::getPermissionsRoleIdByName($row[0]);
if (!\in_array($row[0], $defaultRoles)) {
$defaultRoles[] = $roleId;
}
}
$envs = [
"GRAPH_AVAILABLE_ROLES" => implode(',', $defaultRoles)
];
$response = OcisConfigHelper::reConfigureOcis($envs);
Assert::assertEquals(
200,
$response->getStatusCode(),
"Failed to enable role"
);
$this->setEnabledPermissionsRoles($defaultRoles);
}

/**
* @Given the administrator has disabled the permissions role :role
*
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ default:
- FeatureContext: *common_feature_context_params
- SpacesContext:
- SharingNgContext:
- OcisConfigContext:

apiSharingNgLinkSharePermission:
paths:
Expand Down
Loading

0 comments on commit 97814fa

Please sign in to comment.