b2in/tests/Feature/PageHeroStyleTest.php
Kevin Adametz fcb10be120 Interior-Feinschliff: Hero-Slideshow, Lektorat, Rechtstexte, Aufräumen und Korrekturen 08.10.
Startseite und Heroes
- Hero-Slideshow (11 Motive inkl. Febrü) mit Infokarte, Laufzeit-Linie, größeren Klickflächen,
  Goldrahmen und mobiler Karte unter dem Bild; Zeile über der Überschrift, neue Vertrauenspunkte
- Hero-Stil auf Marken, Über uns und Kontakt übertragen, Breadcrumb entfernt
- Gründer-Leiste, Vision-Box auf Ocker, Showroom-Display in Box mit „Größer ansehen“/Vollbild
- Akzentfarbe #a8741f, größere Serif-Überschriften in der Interior-Welt
- Marken: Bildpause mit Zitat; Vereine aktualisiert und verlinkt

Inhalte
- Lektorat aller angezeigten Texte, /about-Korrekturen, Rechtstexte (DDG, TDDDG, Hosting Hetzner)
- Ablauf Maßanfertigung überall einheitlich, Magazin-Beitrag neu, alte Beiträge offline,
  deutsches Datum/Lesezeit, FAQ Projektausstattung, Otterpohl
- Referenzen-Seite per CMS-Schalter ausblendbar

CMS und Technik
- Tote Sektionen, Felder, Seiten und Komponenten entfernt und archiviert (dev/2026-08-28/archiv-*)
- Entwurf /entwurf, Farb-Schalter und /welcome entfernt; Test-Routen nur noch lokal
- Seitenbaum-Beschreibungen geprüft, fehlende CMS-Felder ergänzt, Markenliste aus „Kernmarken“
- Admin-Bildvorschauen repariert, verwendete Bilder in die Mediathek übernommen
- Seeder für das Deployment siehe dev/2026-08-28/entwicklungsplan.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 14:00:15 +00:00

109 lines
5.1 KiB
PHP

<?php
declare(strict_types=1);
use Database\Seeders\HeroTrustItemsSeeder;
use Database\Seeders\PageHeroEyebrowSeeder;
use FluxCms\Core\Models\CmsContent;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
/**
* Heroes von Marken, Über uns und Kontakt im Stil der Startseite (07.10.2026): Goldrahmen,
* Hintergrundverlauf, weißer Bildrand und Zeile über der Überschrift.
*/
function pageHeroHtml(string $html): string
{
$start = strpos($html, 'id="seitenkopf"') ?: strpos($html, 'id="kontakt"');
return substr($html, (int) $start, 7000);
}
it('gives the interior heroes the gold frame and the eyebrow', function (string $path, string $eyebrow) {
$hero = pageHeroHtml($this->get($path)->assertSuccessful()->getContent());
expect($hero)->toContain('bg-hero-container hero-frame')
->toContain('data-hero-eyebrow')
->toContain($eyebrow);
})->with([
'brands' => ['/marken', 'B2in Interior'],
'about' => ['/about', 'Über B2in'],
'contact' => ['/contact', 'Kontakt'],
]);
it('sets the hero images off with a white hairline', function (string $path) {
expect(pageHeroHtml($this->get($path)->assertSuccessful()->getContent()))->toContain('border border-white!');
})->with(['/marken', '/about']);
it('limits the gold frame to the interior world', function () {
$css = file_get_contents(resource_path('css/web/theme-b2in.css'));
expect($css)->toContain('.world-interior .variante-glass-flow div.hero-frame')
->not->toContain("\ndiv.bg-hero-container.hero-frame");
});
it('adds the eyebrow to stored heroes without overwriting a maintained one', function () {
CmsContent::create(['group' => 'marken', 'key' => 'hero', 'type' => 'json', 'order' => 0,
'value' => ['de' => ['title' => 'Marken', 'eyebrow' => 'Unsere Marken'], 'en' => ['title' => 'Brands', 'eyebrow' => 'Own']]]);
CmsContent::create(['group' => 'about', 'key' => 'hero', 'type' => 'json', 'order' => 0,
'value' => ['de' => ['title' => '<span class="text-secondary">Über B2in:</span> Unsere Mission']]]);
CmsContent::create(['group' => 'contact', 'key' => 'contact_form', 'type' => 'json', 'order' => 0,
'value' => ['de' => ['hero' => ['title' => 'Kontakt'], 'form' => ['x' => 1]]]]);
$this->seed(PageHeroEyebrowSeeder::class);
$this->seed(PageHeroEyebrowSeeder::class);
$marken = CmsContent::where('group', 'marken')->where('key', 'hero')->first()->getTranslations('value');
$contact = CmsContent::where('group', 'contact')->where('key', 'contact_form')->first()->getTranslation('value', 'de');
$about = CmsContent::where('group', 'about')->where('key', 'hero')->first()->getTranslation('value', 'de');
expect($marken['de']['eyebrow'])->toBe('B2in Interior')
->and($about)->toBe(['title' => 'Unsere Mission', 'eyebrow' => 'Über B2in'])
->and($marken['en']['eyebrow'])->toBe('Own')
->and($contact['hero'])->toBe(['title' => 'Kontakt', 'eyebrow' => 'Kontakt'])
->and($contact['form'])->toBe(['x' => 1]);
});
it('shows the eyebrow without capitals and drops the prefix from the about headline', function () {
$about = pageHeroHtml($this->get('/about')->assertSuccessful()->getContent());
expect($about)->not->toContain('Über B2in:')
->toContain('Unsere Mission')
->not->toMatch('/<p class="[^"]*uppercase[^"]*" data-hero-eyebrow/');
});
it('shows the new trust items in the home and brands heroes', function (string $path, array $items) {
$html = $this->get($path)->assertSuccessful()->getContent();
$hero = substr($html, (int) strpos($html, 'data-hero-trust'), 3000);
foreach ($items as $item) {
expect($hero)->toContain($item);
}
expect($hero)->not->toContain('Premium-Marken');
})->with([
'home' => ['/', ['Deutsche Manufakturen', 'Planung bis Montage', 'Zwei Showrooms in Bielefeld']],
'brands' => ['/marken', ['Maßarbeit vom Handwerk', 'Werk und Ausstellung erlebbar', 'Küche, Einbau, Arbeitsplatz']],
]);
it('replaces only the former home trust items and fills empty brand ones', function () {
CmsContent::create(['group' => 'home', 'key' => 'hero', 'type' => 'json', 'order' => 0, 'value' => [
'de' => ['title' => 'Home', 'stats' => HeroTrustItemsSeeder::FORMER_HOME_STATS['de']],
'en' => ['title' => 'Home', 'stats' => ['Own point']],
]]);
CmsContent::create(['group' => 'marken', 'key' => 'hero', 'type' => 'json', 'order' => 0, 'value' => [
'de' => ['title' => 'Marken'],
]]);
$this->seed(HeroTrustItemsSeeder::class);
$this->seed(HeroTrustItemsSeeder::class);
$home = CmsContent::where('group', 'home')->where('key', 'hero')->first()->getTranslations('value');
$marken = CmsContent::where('group', 'marken')->where('key', 'hero')->first()->getTranslation('value', 'de');
expect($home['de']['stats'])->toBe(['Deutsche Manufakturen', 'Planung bis Montage', 'Zwei Showrooms in Bielefeld'])
->and($home['en']['stats'])->toBe(['Own point'])
->and($marken['stats'])->toBe(['Maßarbeit vom Handwerk', 'Werk und Ausstellung erlebbar', 'Küche, Einbau, Arbeitsplatz']);
});