Add profile avatar uploads
linter / quality (pull_request) Successful in 1m28s
tests / ci (8.4) (pull_request) Successful in 1m53s

This commit is contained in:
2026-06-24 13:55:27 +02:00
parent 732f49ee80
commit 598f8631f9
18 changed files with 547 additions and 24 deletions
@@ -5,6 +5,7 @@ namespace Tests\Feature\Admin;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Storage;
use Inertia\Testing\AssertableInertia as Assert;
use Tests\TestCase;
@@ -85,6 +86,8 @@ class UserManagementControllerTest extends TestCase
*/
public function test_admin_can_create_a_user_that_must_change_password_on_next_login(): void
{
Storage::fake('public');
$admin = User::factory()->admin()->create();
$this->actingAs($admin)
@@ -103,6 +106,12 @@ class UserManagementControllerTest extends TestCase
'email' => 'new-member@example.com',
'must_change_password_on_next_login' => true,
]);
$user = User::query()->where('email', 'new-member@example.com')->firstOrFail();
$this->assertTrue($user->avatar_is_generated);
$this->assertNotNull($user->avatar_path);
Storage::disk('public')->assertExists($user->avatar_path);
}
/**