Add guest Live Show opt-in toggle
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user