Display CMS: Footer-Verlauf, Format-Hinweise und Switch-Fixes.
Blendet den B2IN-Text-Verlauf ohne Footer aus, zeigt 9:16-Format-Badges in der Mediathek, normalisiert Modul-Booleans und korrigiert Flux-Switches im Dark Mode. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6c2da9bdac
commit
7491d20d39
14 changed files with 366 additions and 10 deletions
|
|
@ -91,6 +91,23 @@ it('returns display name from title or filename', function () {
|
|||
expect($withoutTitle->getDisplayName())->toBe('file.mp4');
|
||||
});
|
||||
|
||||
it('reports whether media dimensions match the portrait display format', function () {
|
||||
$portrait = DisplayMedia::factory()->create([
|
||||
'metadata' => ['width' => 1080, 'height' => 1920],
|
||||
]);
|
||||
$landscape = DisplayMedia::factory()->create([
|
||||
'metadata' => ['width' => 1920, 'height' => 1080],
|
||||
]);
|
||||
$unknown = DisplayMedia::factory()->create(['metadata' => null]);
|
||||
|
||||
expect($portrait->getDisplayFormatStatus())
|
||||
->toMatchArray(['status' => 'match', 'label' => 'Format passt'])
|
||||
->and($landscape->getDisplayFormatStatus())
|
||||
->toMatchArray(['status' => 'mismatch', 'label' => 'Format passt nicht'])
|
||||
->and($unknown->getDisplayFormatStatus())
|
||||
->toMatchArray(['status' => 'unknown', 'label' => 'Format unbekannt']);
|
||||
});
|
||||
|
||||
it('returns the stored poster as thumbnail url for a video', function () {
|
||||
$media = DisplayMedia::factory()->video()->create([
|
||||
'thumbnail_path' => 'display-media/2026/05/tour-poster.jpg',
|
||||
|
|
@ -229,6 +246,7 @@ it('generates a poster thumbnail when a real video is uploaded', function () {
|
|||
$media = $service->storeUpload($file);
|
||||
|
||||
expect($media->thumbnail_path)->not->toBeNull();
|
||||
expect($media->metadata)->toMatchArray(['width' => 320, 'height' => 240]);
|
||||
expect(Storage::disk('public')->exists($media->thumbnail_path))->toBeTrue();
|
||||
|
||||
@unlink($videoPath);
|
||||
|
|
|
|||
|
|
@ -477,7 +477,8 @@ test('display player keeps previews in a strict 9 by 16 viewport', function () {
|
|||
->toContain('this.settings.claim_position')
|
||||
->toContain('b2in-brand-logo pos-')
|
||||
->toContain('b2in-scrim')
|
||||
->toContain('.b2in-layer.no-footer .b2in-text');
|
||||
->toContain('.b2in-layer.no-footer .b2in-text')
|
||||
->toContain('background: none');
|
||||
});
|
||||
|
||||
test('display player stops looping when the playlist has no playable content', function () {
|
||||
|
|
|
|||
|
|
@ -756,6 +756,53 @@ test('selecting an image medium auto-sets the media type to image', function ()
|
|||
->assertSet('mediaType', 'image');
|
||||
});
|
||||
|
||||
test('b2in media editor shows a matching portrait format badge', function () {
|
||||
$user = User::factory()->create();
|
||||
$version = DisplayVersion::factory()->create(['type' => 'b2in']);
|
||||
$media = DisplayMedia::factory()->create([
|
||||
'type' => 'image',
|
||||
'metadata' => ['width' => 1080, 'height' => 1920],
|
||||
]);
|
||||
|
||||
Livewire::actingAs($user)
|
||||
->test(DisplayVersionEditor::class, ['displayVersion' => $version])
|
||||
->call('openItemModal', null, 'media')
|
||||
->call('onDisplayMediaSelected', 'mediaUrl', $media->id, $media->getUrl())
|
||||
->assertSee('Format passt')
|
||||
->assertSee('1080x1920 px');
|
||||
});
|
||||
|
||||
test('b2in media editor warns for landscape media', function () {
|
||||
$user = User::factory()->create();
|
||||
$version = DisplayVersion::factory()->create(['type' => 'b2in']);
|
||||
$media = DisplayMedia::factory()->create([
|
||||
'type' => 'image',
|
||||
'metadata' => ['width' => 1920, 'height' => 1080],
|
||||
]);
|
||||
|
||||
Livewire::actingAs($user)
|
||||
->test(DisplayVersionEditor::class, ['displayVersion' => $version])
|
||||
->call('openItemModal', null, 'media')
|
||||
->call('onDisplayMediaSelected', 'mediaUrl', $media->id, $media->getUrl())
|
||||
->assertSee('Format passt nicht')
|
||||
->assertSee('1920x1080 px');
|
||||
});
|
||||
|
||||
test('video display editor warns for non portrait video media', function () {
|
||||
$user = User::factory()->create();
|
||||
$version = DisplayVersion::factory()->create(['type' => 'video-display']);
|
||||
$media = DisplayMedia::factory()->video()->create([
|
||||
'metadata' => ['width' => 1920, 'height' => 1080],
|
||||
]);
|
||||
|
||||
Livewire::actingAs($user)
|
||||
->test(DisplayVersionEditor::class, ['displayVersion' => $version])
|
||||
->call('openItemModal', null, 'video')
|
||||
->call('onDisplayMediaSelected', 'videoFilename', $media->id, $media->getUrl())
|
||||
->assertSee('Format passt nicht')
|
||||
->assertSee('1920x1080 px');
|
||||
});
|
||||
|
||||
test('media item modal offers the sonstiges category and an automatic type hint', function () {
|
||||
$user = User::factory()->create();
|
||||
$version = DisplayVersion::factory()->create(['type' => 'b2in']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue