feat(admin): finalize live show settings and related tests
This commit is contained in:
@@ -62,4 +62,32 @@ class LiveShowLinkControllerTest extends TenantTestCase
|
||||
$this->assertIsString($rotatedToken);
|
||||
$this->assertNotSame($firstToken, $rotatedToken);
|
||||
}
|
||||
|
||||
public function test_loading_live_show_link_does_not_mutate_existing_expiry(): void
|
||||
{
|
||||
$this->freezeTime(function (): void {
|
||||
$event = Event::factory()
|
||||
->for($this->tenant)
|
||||
->create([
|
||||
'name' => ['de' => 'Live-Show Ablauf', 'en' => 'Live Show Expiry'],
|
||||
'slug' => 'live-show-fixed-expiry',
|
||||
'date' => now()->addDays(3)->startOfDay(),
|
||||
]);
|
||||
$event->ensureLiveShowToken();
|
||||
$customExpiry = now()->addHours(4)->toImmutable();
|
||||
$event->forceFill(['live_show_token_expires_at' => $customExpiry])->saveQuietly();
|
||||
|
||||
$first = $this->authenticatedRequest('GET', "/api/v1/tenant/events/{$event->slug}/live-show/link");
|
||||
$first->assertOk();
|
||||
$firstExpiry = $first->json('data.expires_at');
|
||||
|
||||
$this->travel(8)->hours();
|
||||
|
||||
$second = $this->authenticatedRequest('GET', "/api/v1/tenant/events/{$event->slug}/live-show/link");
|
||||
$second->assertOk();
|
||||
|
||||
$this->assertIsString($firstExpiry);
|
||||
$this->assertSame($firstExpiry, $second->json('data.expires_at'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user