ImageColumn::make('logo') had no explicit disk, so it defaulted to
Filament's local disk while uploads write to the public disk,
causing the file-existence check to fail and the src to render
empty. Align the column's disk with the upload field's disk.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015HaT8a5ZWh45JkjTLPWeaP
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Livewire\Livewire;
|
||||
use Modules\Catalog\Filament\Resources\EvCompanies\Pages\CreateEvCompany;
|
||||
@@ -26,6 +27,17 @@ test('can list ev companies', function () {
|
||||
->assertCanSeeTableRecords($companies);
|
||||
});
|
||||
|
||||
test('renders the logo from the public disk in the table', function () {
|
||||
Storage::fake('public');
|
||||
Storage::disk('public')->put('logos/example.png', 'fake-image-contents');
|
||||
|
||||
$company = EvCompany::factory()->create(['logo' => 'logos/example.png']);
|
||||
|
||||
Livewire::test(ListEvCompanies::class)
|
||||
->assertOk()
|
||||
->assertSee(Storage::disk('public')->url($company->logo), escape: false);
|
||||
});
|
||||
|
||||
test('can create an ev company', function () {
|
||||
$company = EvCompany::factory()->make();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user