Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
vd1992 committed Jun 25, 2024
1 parent 7f03c47 commit a17b338
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions api/tests/Feature/UserRoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ protected function setUp(): void
->asApplicant()
->asRequestResponder()
->asAdmin()
->asCommunityManager()
->create([
'email' => 'admin-user@test.com',
'sub' => 'admin-user@test.com',
Expand Down Expand Up @@ -205,8 +206,8 @@ public function testAdminCanSeeUsersTeams()
// Create a user with an old role. Assert that the admin can remove the old role and add the new role.
public function testAdminCanAddAndRemoveNonTeamRoleToUser()
{
$oldRole = Role::factory()->create(['is_team_based' => false]);
$newRole = Role::factory()->create(['is_team_based' => false]);
$oldRole = Role::where('name', 'guest')->sole();
$newRole = Role::where('name', 'base_user')->sole();
$user = User::factory()->create()->syncRoles([$oldRole]);

$this->actingAs($this->adminUser, 'api')->graphQL(
Expand Down Expand Up @@ -249,8 +250,8 @@ public function testAdminCanAddAndRemoveNonTeamRoleToUser()
// Create a user with an old role. Assert that the admin can remove the old role and add the new role, now with teams!
public function testAdminCanAddAndRemoveTeamRoleToUser()
{
$oldRole = Role::factory()->create(['is_team_based' => true]);
$newRole = Role::factory()->create(['is_team_based' => true]);
$oldRole = Role::where('name', 'pool_operator')->sole();
$newRole = Role::where('name', 'process_operator')->sole();
$oldTeam = Team::factory()->create();
$newTeam = Team::factory()->create();
$user = User::factory()->create()->syncRoles([$oldRole], $oldTeam);
Expand Down

0 comments on commit a17b338

Please sign in to comment.