feat(inspections): add photos support with edit + lightbox
- Validación robusta fotos (10MB, jpeg/png/webp, max 10) - Editar inspección existente: botón en historial, modal y tabla - Eliminación individual de fotos en edición (marcar + guardar) - Lightbox/carousel en modal ver + editar (Alpine.js) - Columna 'Fotos' en InspectionTable con thumbnails + contador - Permiso 'edit inspections' en seeders + checks en componente - Test actualizado: seed roles/permisos + attach template pivot - Fix: removed unsupported filterable() on secondaryHeaderFilter
This commit is contained in:
@@ -24,7 +24,13 @@ class InspectionFormTest extends TestCase
|
||||
{
|
||||
Storage::fake('public');
|
||||
|
||||
// Seed roles and permissions
|
||||
$this->seed(\Database\Seeders\RolesAndPermissionsSeeder::class);
|
||||
$this->seed(\Database\Seeders\PermissionCatalogSeeder::class);
|
||||
|
||||
$user = User::factory()->create();
|
||||
$user->assignRole('Supervisor');
|
||||
|
||||
$project = Project::create([
|
||||
'reference' => 'INS', 'name' => 'Proyecto Insp', 'address' => 'x', 'lat' => 40, 'lng' => -3,
|
||||
'start_date' => now()->toDateString(), 'end_date_estimated' => now()->addMonth()->toDateString(),
|
||||
@@ -45,6 +51,9 @@ class InspectionFormTest extends TestCase
|
||||
],
|
||||
]);
|
||||
|
||||
// Attach template to project (pivot required for loadTemplates)
|
||||
$project->inspectionTemplates()->attach($template->id);
|
||||
|
||||
Livewire::actingAs($user)
|
||||
->test(ProjectMap::class, ['project' => $project])
|
||||
->call('selectFeature', $feature->id)
|
||||
@@ -60,4 +69,4 @@ class InspectionFormTest extends TestCase
|
||||
$this->assertEquals('5.2', $ins->data['altura']);
|
||||
$this->assertCount(1, $ins->media);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user