Display Module 13-05-2026

This commit is contained in:
Kevin Adametz 2026-05-13 14:34:08 +02:00
parent 6a65354f4c
commit 9262132325
41 changed files with 496 additions and 334 deletions

View file

@ -79,9 +79,6 @@ test('can assign versions to a display', function () {
->call('save');
$display->refresh();
expect($display->versions)->toHaveCount(2);
expect($display->versions->first()->id)->toBe($version1->id);
expect($display->versions->last()->id)->toBe($version2->id);
expect($display->livePlaylist->modules->pluck('id')->all())->toBe([$version1->id, $version2->id]);
});
@ -100,8 +97,6 @@ test('can reorder versions in playlist', function () {
->call('save');
$display->refresh();
expect($display->versions->first()->id)->toBe($version2->id);
expect($display->versions->last()->id)->toBe($version1->id);
expect($display->livePlaylist->modules->pluck('id')->all())->toBe([$version2->id, $version1->id]);
});
@ -110,10 +105,7 @@ test('can remove version from playlist', function () {
$version1 = DisplayVersion::factory()->create();
$version2 = DisplayVersion::factory()->create();
$display = Display::factory()->create();
$display->versions()->attach([
$version1->id => ['sort_order' => 0],
$version2->id => ['sort_order' => 1],
]);
createDisplayListPlaylist($display, DisplayPlaylist::STATUS_PUBLISHED, [$version1->id, $version2->id]);
Livewire::actingAs($user)
->test(DisplayList::class)
@ -122,8 +114,6 @@ test('can remove version from playlist', function () {
->call('save');
$display->refresh();
expect($display->versions)->toHaveCount(1);
expect($display->versions->first()->id)->toBe($version2->id);
expect($display->livePlaylist->modules->pluck('id')->all())->toBe([$version2->id]);
});
@ -233,7 +223,6 @@ test('can publish a draft playlist over the live playlist', function () {
expect($display->draftPlaylist)->toBeNull();
expect($display->livePlaylist->modules->pluck('id')->all())->toBe([$draftVersion->id]);
expect($display->versions->pluck('id')->all())->toBe([$draftVersion->id]);
});
test('can edit live playlist without changing draft playlist', function () {
@ -277,7 +266,6 @@ test('can edit draft playlist without changing live playlist', function () {
expect($display->preview_token)->not->toBeNull();
expect($display->livePlaylist->modules->pluck('id')->all())->toBe([$liveVersion->id]);
expect($display->draftPlaylist->modules->pluck('id')->all())->toBe([$draftVersion->id, $newDraftVersion->id]);
expect($display->versions->pluck('id')->all())->toBe([]);
});
test('draft editor renders iframe preview url', function () {
@ -354,9 +342,26 @@ test('renders live and draft playlist columns', function () {
->test(DisplayList::class)
->assertSee('Live Modul')
->assertSee('Draft Modul')
->assertSee('Öffentliche Display-Übersicht')
->assertSee('Display-Übersicht öffnen')
->assertSee('https://cabinet.b2in.eu/display/', false)
->assertSee('Live bearbeiten')
->assertSee('Live-URL zum Kopieren')
->assertSee(url('/_cabinet/display/index.html').'?id='.$display->id, false)
->assertSee('https://cabinet.b2in.eu/display/?id='.$display->id, false)
->assertSee('Entwurf bearbeiten')
->assertSee('Test-Display');
});
test('display live urls fall back to cabinet domain when config is empty', function () {
config(['display.player_url' => '']);
$user = User::factory()->create();
$version = DisplayVersion::factory()->create(['name' => 'Live Modul']);
$display = Display::factory()->create();
createDisplayListPlaylist($display, DisplayPlaylist::STATUS_PUBLISHED, [$version->id]);
Livewire::actingAs($user)
->test(DisplayList::class)
->assertSee('https://cabinet.b2in.eu/display/', false)
->assertSee('https://cabinet.b2in.eu/display/?id='.$display->id, false);
});