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
+13
View File
@@ -2,7 +2,9 @@
namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Storage;
use Laravel\Fortify\Features;
use Tests\TestCase;
@@ -26,6 +28,8 @@ class RegistrationTest extends TestCase
public function test_new_users_can_register()
{
Storage::fake('public');
$response = $this->post(route('register.store'), [
'name' => 'Test User',
'email' => 'test@example.com',
@@ -35,5 +39,14 @@ class RegistrationTest extends TestCase
$this->assertAuthenticated();
$response->assertRedirect(route('dashboard', absolute: false));
$user = User::query()->where('email', 'test@example.com')->firstOrFail();
$this->assertTrue($user->avatar_is_generated);
$this->assertNotNull($user->avatar_color);
$this->assertNotNull($user->avatar_path);
Storage::disk('public')->assertExists($user->avatar_path);
$this->assertStringContainsString('TU', Storage::disk('public')->get($user->avatar_path));
}
}