Display Module 13-05-2026
This commit is contained in:
parent
6a65354f4c
commit
9262132325
41 changed files with 496 additions and 334 deletions
|
|
@ -214,14 +214,34 @@ test('check endpoint returns only updated_at', function () {
|
|||
$response->assertJsonStructure(['updated_at']);
|
||||
});
|
||||
|
||||
test('display config ignores legacy pivot and reads published playlist', function () {
|
||||
$legacyVersion = DisplayVersion::factory()->create(['type' => 'video-display', 'name' => 'Legacy']);
|
||||
DisplayVersionItem::factory()->create([
|
||||
'display_version_id' => $legacyVersion->id,
|
||||
'item_type' => 'video',
|
||||
'content' => ['filename' => 'legacy.mp4', 'title' => 'Legacy', 'position' => 25],
|
||||
test('display overview lists active displays with published modules', function () {
|
||||
$liveVersion = DisplayVersion::factory()->create(['name' => 'Live Module']);
|
||||
$activeDisplay = Display::factory()->create([
|
||||
'name' => 'Showroom Eingang',
|
||||
'location' => 'Bielefeld',
|
||||
'is_active' => true,
|
||||
]);
|
||||
publishDisplayModules($activeDisplay, [$liveVersion->id]);
|
||||
|
||||
$inactiveDisplay = Display::factory()->create(['is_active' => false]);
|
||||
publishDisplayModules($inactiveDisplay, [$liveVersion->id]);
|
||||
|
||||
Display::factory()->create(['name' => 'Ohne Live']);
|
||||
|
||||
$response = $this->getJson('/api/display/overview');
|
||||
|
||||
$response->assertSuccessful()
|
||||
->assertJsonCount(1, 'displays')
|
||||
->assertJsonPath('displays.0.id', $activeDisplay->id)
|
||||
->assertJsonPath('displays.0.name', 'Showroom Eingang')
|
||||
->assertJsonPath('displays.0.location', 'Bielefeld')
|
||||
->assertJsonPath('displays.0.is_active', true)
|
||||
->assertJsonPath('displays.0.is_live', true)
|
||||
->assertJsonPath('displays.0.module_count', 1)
|
||||
->assertJsonPath('displays.0.url', 'https://cabinet.b2in.eu/display/?id='.$activeDisplay->id);
|
||||
});
|
||||
|
||||
test('display config reads published playlist', function () {
|
||||
$publishedVersion = DisplayVersion::factory()->create(['type' => 'video-display', 'name' => 'Published']);
|
||||
DisplayVersionItem::factory()->create([
|
||||
'display_version_id' => $publishedVersion->id,
|
||||
|
|
@ -230,7 +250,6 @@ test('display config ignores legacy pivot and reads published playlist', functio
|
|||
]);
|
||||
|
||||
$display = Display::factory()->create();
|
||||
$display->versions()->attach($legacyVersion->id, ['sort_order' => 0]);
|
||||
publishDisplayModules($display, [$publishedVersion->id]);
|
||||
|
||||
$response = $this->getJson("/api/display/{$display->id}/config");
|
||||
|
|
@ -391,6 +410,11 @@ test('display player keeps previews in a strict 9 by 16 viewport', function () {
|
|||
->toContain('width: min(100vw, calc(100vh * 9 / 16));')
|
||||
->toContain('height: min(100vh, calc(100vw * 16 / 9));')
|
||||
->toContain('container-type: size;')
|
||||
->toContain("if (hostname === 'cabinet.b2in.eu') {")
|
||||
->toContain("return 'https://portal.b2in.eu';")
|
||||
->toContain('/api/display/overview')
|
||||
->toContain('Aktive Live-Displays')
|
||||
->toContain('renderOverview(data.displays || [])')
|
||||
->toContain('translate(${offsetX}px, ${offsetY}px) scale(${scale})')
|
||||
->toContain('this.settings.logo_url')
|
||||
->toContain('this.settings.footer_claim')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue