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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user