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('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']); });