Moved invitation from jetstream to API; Deactived moved jetstream features

This commit is contained in:
Constantin Graf
2024-07-15 17:17:56 +02:00
committed by Constantin Graf
parent 555417dbbd
commit fd8d596e9b
25 changed files with 294 additions and 348 deletions

View File

@@ -12,31 +12,20 @@ class RemoveTeamMemberTest extends TestCase
{
use RefreshDatabase;
public function test_team_members_can_be_removed_from_teams(): void
public function test_team_members_can_no_longer_be_removed_from_teams_over_jetstream_endpoints(): void
{
// Arrange
$this->actingAs($user = User::factory()->withPersonalOrganization()->create());
$user->currentTeam->users()->attach(
$otherUser = User::factory()->create(), ['role' => 'admin']
);
$response = $this->withoutExceptionHandling()->delete('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id);
// Act
$response = $this->delete('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id);
$this->assertCount(1, $user->currentTeam->fresh()->users);
}
public function test_only_team_owner_can_remove_team_members(): void
{
$user = User::factory()->withPersonalOrganization()->create();
$user->currentTeam->users()->attach(
$otherUser = User::factory()->create(), ['role' => 'admin']
);
$this->actingAs($otherUser);
$response = $this->delete('/teams/'.$user->currentTeam->id.'/members/'.$user->id);
$response->assertForbidden();
// Assert
$response->assertStatus(403);
$response->assertSee('Moved to API');
}
}