Add live show docs and smoke 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-01-05 19:42:58 +01:00
parent 53eb560aa5
commit 3f3061a899
10 changed files with 230 additions and 3 deletions

View File

@@ -88,4 +88,49 @@ class LiveShowRealtimeTest extends TestCase
$response->assertNotFound();
}
public function test_live_show_updates_returns_settings_when_version_changes(): void
{
$event = Event::factory()->create([
'live_show_token' => str_repeat('c', 64),
'settings' => [
'live_show' => [
'effect_preset' => 'film_cut',
],
],
]);
$state = $this->getJson("/api/v1/live-show/{$event->live_show_token}");
$state->assertOk();
$version = $state->json('settings_version');
$updates = $this->getJson("/api/v1/live-show/{$event->live_show_token}/updates?settings_version={$version}");
$updates->assertOk();
$updates->assertJsonPath('settings', null);
$event->forceFill([
'settings' => [
'live_show' => [
'effect_preset' => 'shutter_flash',
],
],
])->save();
$updates = $this->getJson("/api/v1/live-show/{$event->live_show_token}/updates?settings_version={$version}");
$updates->assertOk();
$updates->assertJsonMissing(['settings' => null]);
$updates->assertJsonPath('settings.effect_preset', 'shutter_flash');
}
public function test_live_show_updates_rejects_invalid_cursor(): void
{
$event = Event::factory()->create([
'live_show_token' => str_repeat('d', 64),
]);
$response = $this->getJson("/api/v1/live-show/{$event->live_show_token}/updates?after_approved_at=invalid&after_id=1");
$response->assertStatus(422);
$response->assertJsonPath('error', 'invalid_cursor');
}
}

View File

@@ -0,0 +1,14 @@
import { test, expectFixture as expect, dismissConsentBanner } from '../helpers/test-fixtures';
const liveShowToken = process.env.E2E_LIVE_SHOW_TOKEN;
test.describe('Live Show Player', () => {
test('loads the player shell', async ({ page }) => {
test.skip(!liveShowToken, 'Set E2E_LIVE_SHOW_TOKEN to a valid live show token.');
await page.goto(`/show/${liveShowToken}`);
await dismissConsentBanner(page);
await expect(page.getByRole('button', { name: /Pause|Play|Weiter/i })).toBeVisible();
});
});