12-05-2026 admin, Panel Displays

This commit is contained in:
Kevin Adametz 2026-05-12 18:28:38 +02:00
parent 0762e3beac
commit 6a65354f4c
43 changed files with 3273 additions and 410 deletions

View file

@ -142,6 +142,41 @@ it('stores a video upload', function () {
->and($media->mime_type)->toBe('video/mp4');
});
it('stores an svg upload as image media', function () {
$service = app(DisplayMediaService::class);
$file = UploadedFile::fake()->createWithContent(
'logo.svg',
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10"/></svg>'
);
$media = $service->storeUpload($file);
expect($media->filename)->toBe('logo.svg')
->and($media->type)->toBe('image')
->and($media->mime_type)->toBe('image/svg+xml');
expect(Storage::disk('public')->exists($media->path))->toBeTrue();
});
it('accepts svg uploads in the display media library', function () {
$file = UploadedFile::fake()->createWithContent(
'brand.svg',
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><circle cx="5" cy="5" r="5"/></svg>'
);
Volt::test('admin.cms.display-media-library')
->set('uploads', [$file])
->call('handleUploads')
->assertHasNoErrors();
$media = DisplayMedia::query()->first();
expect($media)->not->toBeNull()
->and($media->filename)->toBe('brand.svg')
->and($media->type)->toBe('image')
->and($media->mime_type)->toBe('image/svg+xml');
});
it('accepts display media videos up to 200 mb', function () {
$file = UploadedFile::fake()->create('showroom.mp4', 204800, 'video/mp4');