Expand branding controls and logo upload
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-15 08:42:20 +01:00
parent 81446b37c3
commit 8634d16359
11 changed files with 906 additions and 139 deletions

View File

@@ -232,6 +232,48 @@ class EventControllerTest extends TenantTestCase
$this->assertSame('blur_last', data_get($settings, 'live_show.background_mode'));
}
public function test_update_event_uploads_branding_logo_data_url(): void
{
Storage::fake('public');
$eventType = EventType::factory()->create();
$event = Event::factory()->for($this->tenant)->create([
'event_type_id' => $eventType->id,
'name' => 'Branding Event',
'slug' => 'branding-event',
'date' => now()->addDays(5),
]);
$logoFile = UploadedFile::fake()->image('logo.png', 64, 64);
$logoContents = file_get_contents($logoFile->getRealPath());
$this->assertIsString($logoContents);
$logoDataUrl = 'data:image/png;base64,'.base64_encode($logoContents);
$response = $this->authenticatedRequest('PUT', "/api/v1/tenant/events/{$event->slug}", [
'name' => 'Branding Event',
'event_date' => now()->addDays(5)->toDateString(),
'event_type_id' => $eventType->id,
'settings' => [
'branding' => [
'logo_data_url' => $logoDataUrl,
'logo' => [
'mode' => 'upload',
'value' => $logoDataUrl,
],
],
],
]);
$response->assertOk();
$event->refresh();
$logoPath = (string) data_get($event->settings, 'branding.logo_url');
$this->assertNotEmpty($logoPath);
Storage::disk('public')->assertExists($logoPath);
$this->assertSame($logoPath, data_get($event->settings, 'branding.logo.value'));
$this->assertNull(data_get($event->settings, 'branding.logo_data_url'));
}
public function test_upload_exceeds_package_limit_fails(): void
{
$tenant = $this->tenant;