- dev/betrieb/deploy.sh: Deploy nur per Tag, mit --seed (Seeder im Wartungsmodus) und --initial (Vorschau/Live einmalig an Ort und Stelle auf Git umstellen) - dev/betrieb/vorschau-auffrischen.sh: Live-DB und Live-Medien in die Vorschau (Generalprobe) - InteriorReleaseSeeder: alle Inhaltsschritte des Relaunchs in einem Lauf, idempotent; Displays, Playlists und Mediathek bleiben unberührt - DisplayInteriorBrandingSeeder überschreibt keinen inzwischen gepflegten Claim mehr - Monitoring: GlitchTip (Server + Browser), /health mit Token, Scheduler-Herzschlag, Alarme per Mail und ntfy, Version in about und /health - public/build versioniert; .gitignore: macOS-Muster Icon traf resources/views/flux/icon/ - Runbook: dev/betrieb/README.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
86 lines
3.6 KiB
PHP
86 lines
3.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Enums\DisplayVersionType;
|
|
use App\Models\DisplayVersion;
|
|
use App\Support\DisplayModuleSettings;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
it('defaults to the interior logo and the new claim', function () {
|
|
$defaults = DisplayModuleSettings::defaults(DisplayVersionType::B2in);
|
|
|
|
expect($defaults['header_logo_url'])->toBe('/_cabinet/assets/b2in-interior-logo-negative.svg');
|
|
expect($defaults['header_claim'])->toBe('Premium-Einrichtung. Persönlich gemacht.');
|
|
});
|
|
|
|
it('uses the white logo variant because the default theme is dark', function () {
|
|
$defaults = DisplayModuleSettings::defaults(DisplayVersionType::B2in);
|
|
|
|
expect($defaults['theme'])->toBe('dark');
|
|
expect($defaults['header_logo_url'])->toContain('negative');
|
|
});
|
|
|
|
it('ships both logo variants to the display assets', function () {
|
|
expect(file_exists(public_path('_cabinet/assets/b2in-interior-logo-negative.svg')))->toBeTrue();
|
|
expect(file_exists(public_path('_cabinet/assets/b2in-interior-logo-positive.svg')))->toBeTrue();
|
|
});
|
|
|
|
it('unifies the branding of existing modules and picks the variant by theme', function () {
|
|
$dark = DisplayVersion::factory()->create([
|
|
'type' => DisplayVersionType::B2in,
|
|
'settings' => ['theme' => 'dark', 'header_logo_url' => 'https://b2in.test/storage/alt.png', 'header_claim' => 'Hello'],
|
|
]);
|
|
|
|
$light = DisplayVersion::factory()->create([
|
|
'type' => DisplayVersionType::B2in,
|
|
'settings' => ['theme' => 'light', 'header_logo_url' => '../assets/b2in-logo-positive.svg', 'header_claim' => 'Connecting Design & Property'],
|
|
]);
|
|
|
|
$this->seed(\Database\Seeders\DisplayInteriorBrandingSeeder::class);
|
|
|
|
expect($dark->fresh()->settings['header_logo_url'])->toBe('/_cabinet/assets/b2in-interior-logo-negative.svg');
|
|
expect($light->fresh()->settings['header_logo_url'])->toBe('/_cabinet/assets/b2in-interior-logo-positive.svg');
|
|
|
|
expect($dark->fresh()->settings['header_claim'])->toBe('Premium-Einrichtung. Persönlich gemacht.');
|
|
expect($light->fresh()->settings['header_claim'])->toBe('Premium-Einrichtung. Persönlich gemacht.');
|
|
});
|
|
|
|
it('leaves the other module settings alone', function () {
|
|
$module = DisplayVersion::factory()->create([
|
|
'type' => DisplayVersionType::B2in,
|
|
'settings' => ['theme' => 'dark', 'footer_url' => 'B2in.eu', 'default_image_duration' => 25, 'show_footer' => false],
|
|
]);
|
|
|
|
$this->seed(\Database\Seeders\DisplayInteriorBrandingSeeder::class);
|
|
|
|
$settings = $module->fresh()->settings;
|
|
|
|
expect($settings['footer_url'])->toBe('B2in.eu');
|
|
expect($settings['default_image_duration'])->toBe(25);
|
|
expect($settings['show_footer'])->toBeFalse();
|
|
});
|
|
|
|
it('keeps modules that already carry the interior logo, including a claim maintained since', function () {
|
|
$module = DisplayVersion::factory()->create([
|
|
'type' => DisplayVersionType::B2in,
|
|
'settings' => ['theme' => 'dark', 'header_logo_url' => '/_cabinet/assets/b2in-interior-logo-negative.svg', 'header_claim' => 'Eigener Claim'],
|
|
]);
|
|
|
|
$this->seed(\Database\Seeders\DisplayInteriorBrandingSeeder::class);
|
|
|
|
expect($module->fresh()->settings['header_claim'])->toBe('Eigener Claim');
|
|
});
|
|
|
|
it('does not touch modules of other types', function () {
|
|
$video = DisplayVersion::factory()->create([
|
|
'type' => DisplayVersionType::VideoDisplay,
|
|
'settings' => ['qr_label' => 'Website'],
|
|
]);
|
|
|
|
$this->seed(\Database\Seeders\DisplayInteriorBrandingSeeder::class);
|
|
|
|
expect($video->fresh()->settings)->toBe(['qr_label' => 'Website']);
|
|
});
|