Add live show docs and smoke tests
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
14
tests/ui/guest/live-show-player.test.ts
Normal file
14
tests/ui/guest/live-show-player.test.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user