Add guest Live Show opt-in toggle

This commit is contained in:
Codex Agent
2026-01-05 15:29:59 +01:00
parent 15be3b847c
commit 35ef8f1586
8 changed files with 116 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
namespace Tests\Feature;
use App\Enums\PhotoLiveStatus;
use App\Models\Event;
use App\Models\EventPackage;
use App\Models\GuestPolicySetting;
@@ -98,6 +99,7 @@ class GuestJoinTokenFlowTest extends TestCase
$response = $this->withHeader('X-Device-Id', 'token-device')
->postJson("/api/v1/events/{$token->token}/upload", [
'photo' => $file,
'live_show_opt_in' => true,
]);
$response->assertCreated()
@@ -108,6 +110,8 @@ class GuestJoinTokenFlowTest extends TestCase
$saved = Photo::first();
$this->assertNotNull($saved);
$this->assertEquals($event->id, $saved->event_id);
$this->assertSame(PhotoLiveStatus::PENDING, $saved->live_status);
$this->assertNotNull($saved->live_submitted_at);
$storedPath = $saved->file_path
? ltrim(str_replace('/storage/', '', $saved->file_path), '/')
@@ -134,6 +138,24 @@ class GuestJoinTokenFlowTest extends TestCase
->assertJsonPath('demo_read_only', true);
}
public function test_guest_event_response_includes_live_show_settings(): void
{
$event = $this->createPublishedEvent();
$event->update([
'settings' => [
'live_show' => [
'moderation_mode' => 'manual',
],
],
]);
$token = $this->tokenService->createToken($event);
$response = $this->getJson("/api/v1/events/{$token->token}");
$response->assertOk()
->assertJsonPath('live_show.moderation_mode', 'manual');
}
public function test_guest_cannot_upload_photo_with_demo_token(): void
{
Storage::fake('public');