Fix share assets, shared photo UI, and live show expiry
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-02-06 07:30:30 +01:00
parent 18b4f36fcf
commit b14435df8b
12 changed files with 352 additions and 85 deletions

View File

@@ -10,6 +10,7 @@ use App\Models\Tenant;
use App\Services\EventJoinTokenService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
class PhotoShareLinkTest extends TestCase
@@ -64,13 +65,18 @@ class PhotoShareLinkTest extends TestCase
public function test_share_payload_exposes_public_photo_data(): void
{
Config::set('filesystems.default', 'public');
Storage::fake('public');
$tenant = Tenant::factory()->create();
$event = Event::factory()->for($tenant)->create(['status' => 'published']);
$task = Task::factory()->for($tenant)->create();
$photo = Photo::factory()->for($event)->create([
'status' => 'approved',
'task_id' => $task->id,
'file_path' => 'photos/share-test.jpg',
'thumbnail_path' => 'photos/thumbnails/share-test.jpg',
]);
Storage::disk('public')->put('photos/share-test.jpg', 'photo');
$share = PhotoShareLink::factory()->for($photo)->create([
'expires_at' => now()->addDay(),
@@ -95,5 +101,16 @@ class PhotoShareLinkTest extends TestCase
'buttons',
],
]);
$assetUrl = $response->json('photo.image_urls.full');
$this->assertIsString($assetUrl);
$this->assertNotNull(parse_url($assetUrl, PHP_URL_SCHEME));
$parsed = parse_url($assetUrl);
$path = (string) ($parsed['path'] ?? '');
$query = $parsed['query'] ?? null;
$assetResponse = $this->get($path.($query ? "?{$query}" : ''));
$assetResponse->assertOk();
}
}