feat(admin): finalize live show settings and related tests
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user