feat(admin): finalize live show settings and related tests
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 08:43:50 +01:00
parent 0a08f2704f
commit 61d1bbc707
8 changed files with 314 additions and 6 deletions

View File

@@ -52,6 +52,25 @@ class LiveShowDataModelTest extends TestCase
$this->assertSame($newDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
}
public function test_ensuring_existing_live_show_token_does_not_mutate_existing_expiry(): void
{
$this->freezeTime(function (): void {
$eventDate = now()->addDays(5)->startOfDay();
$event = Event::factory()->create(['date' => $eventDate]);
$event->rotateLiveShowToken();
$customExpiry = now()->addHours(6)->toImmutable();
$event->forceFill(['live_show_token_expires_at' => $customExpiry])->saveQuietly();
$initialExpiry = $event->refresh()->live_show_token_expires_at?->toIso8601String();
$this->travel(6)->hours();
$event->refresh()->ensureLiveShowToken();
$expiryAfterEnsure = $event->refresh()->live_show_token_expires_at?->toIso8601String();
$this->assertNotNull($initialExpiry);
$this->assertSame($initialExpiry, $expiryAfterEnsure);
});
}
public function test_photo_live_status_is_cast_and_defaults_to_none(): void
{
$photo = Photo::factory()->create();