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

@@ -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'));
});
}
}