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

@@ -15,7 +15,8 @@ class LiveShowDataModelTest extends TestCase
public function test_event_can_ensure_and_rotate_live_show_token(): void
{
$event = Event::factory()->create();
$eventDate = now()->addDays(1)->startOfDay();
$event = Event::factory()->create(['date' => $eventDate]);
$token = $event->ensureLiveShowToken();
@@ -23,6 +24,7 @@ class LiveShowDataModelTest extends TestCase
$this->assertSame(64, strlen($token));
$this->assertSame($token, $event->refresh()->live_show_token);
$this->assertNotNull($event->live_show_token_rotated_at);
$this->assertSame($eventDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
$rotated = $event->rotateLiveShowToken();
@@ -30,6 +32,24 @@ class LiveShowDataModelTest extends TestCase
$this->assertSame(64, strlen($rotated));
$this->assertNotSame($token, $rotated);
$this->assertSame($rotated, $event->refresh()->live_show_token);
$this->assertSame($eventDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
}
public function test_live_show_token_expiry_updates_when_event_date_changes(): void
{
$eventDate = now()->addDays(3)->startOfDay();
$event = Event::factory()->create(['date' => $eventDate]);
$event->ensureLiveShowToken();
$event->refresh();
$this->assertSame($eventDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
$newDate = now()->addDays(7)->startOfDay();
$event->update(['date' => $newDate]);
$event->refresh();
$this->assertSame($newDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
}
public function test_photo_live_status_is_cast_and_defaults_to_none(): void