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>
195 lines
6.9 KiB
PHP
195 lines
6.9 KiB
PHP
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
use App\Models\CmsArticle;
|
||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||
|
||
uses(RefreshDatabase::class);
|
||
|
||
it('magazin list page loads successfully', function () {
|
||
$this->get('/magazin')
|
||
->assertSuccessful()
|
||
->assertSee('Magazin');
|
||
});
|
||
|
||
it('magazin list shows the interior articles and leaves the dubai ones to the real estate list', function () {
|
||
$this->get('/magazin')
|
||
->assertSuccessful()
|
||
->assertSee('Nach Maß statt von der Stange', false)
|
||
->assertSee('Küche planen', false)
|
||
->assertDontSee('Supply-Chain-Management')
|
||
->assertDontSee('Local for Local')
|
||
->assertDontSee('Escrow-System')
|
||
->assertDontSee('Al Jaddaf')
|
||
->assertDontSee('Turnkey-Investments');
|
||
|
||
$this->get('/immobilien/magazin')
|
||
->assertSuccessful()
|
||
->assertSee('Escrow-System')
|
||
->assertSee('Al Jaddaf')
|
||
->assertSee('Turnkey-Investments')
|
||
->assertDontSee('Supply-Chain-Management')
|
||
->assertDontSee('Local for Local');
|
||
});
|
||
|
||
it('magazin detail page loads for the first article', function () {
|
||
$this->get('/magazin/escrow-system-dubai-investoren')
|
||
->assertSuccessful()
|
||
->assertSee('Escrow-System')
|
||
->assertSee('Dubai Land Department');
|
||
});
|
||
|
||
it('takes the articles of the former direction offline (08.10.2026)', function () {
|
||
$this->get('/magazin/local-for-local-regionaler-moebelhandel')->assertNotFound();
|
||
$this->get('/magazin/supply-chain-management-vertragssicherheit')->assertNotFound();
|
||
});
|
||
|
||
it('serves every published article by its slug', function () {
|
||
$offline = ['supply-chain-management-vertragssicherheit', 'local-for-local-regionaler-moebelhandel'];
|
||
|
||
foreach (array_diff(CmsArticle::LEGACY_ID_TO_SLUG, $offline) as $slug) {
|
||
$this->get('/magazin/'.$slug)->assertSuccessful();
|
||
}
|
||
});
|
||
|
||
it('shows the rewritten custom-made article with paragraphs, German date and the general closing line', function () {
|
||
$html = $this->get('/magazin/massanfertigung-warum-der-millimeter-zaehlt')->assertSuccessful()->getContent();
|
||
|
||
expect($html)->toContain('Warum am Ende der Millimeter zählt – und am Anfang grobe Maße reichen')
|
||
->toContain('Erst die Idee, dann der Millimeter')
|
||
->toContain('<p class="text-muted-foreground leading-relaxed">Denn spätestens jetzt zählt tatsächlich jeder Millimeter.</p>')
|
||
->toContain('26. August 2026')
|
||
->toContain('5 Min. Lesezeit')
|
||
->toContain('Weitere Einblicke rund um Einrichtung, Planung und Projekte finden Sie im')
|
||
->not->toContain('Ökosystem')
|
||
->not->toContain('min read');
|
||
});
|
||
|
||
it('returns 404 for an unknown slug instead of silently showing the first article', function () {
|
||
$this->get('/magazin/gibt-es-nicht')->assertNotFound();
|
||
});
|
||
|
||
it('links to the articles by slug, not by id', function () {
|
||
$this->get('/immobilien/magazin')
|
||
->assertSuccessful()
|
||
->assertSee('/magazin/escrow-system-dubai-investoren');
|
||
});
|
||
|
||
// ========================================
|
||
// Alte numerische URLs
|
||
// ========================================
|
||
|
||
it('redirects the old numeric URLs permanently to the slug', function () {
|
||
foreach (CmsArticle::LEGACY_ID_TO_SLUG as $id => $slug) {
|
||
$this->get('/magazin/'.$id)
|
||
->assertStatus(301)
|
||
->assertRedirect('/magazin/'.$slug);
|
||
}
|
||
});
|
||
|
||
it('returns 404 for a numeric URL that never existed', function () {
|
||
$this->get('/magazin/999')->assertNotFound();
|
||
});
|
||
|
||
// ========================================
|
||
// CMS-Anbindung
|
||
// ========================================
|
||
|
||
it('renders what is maintained in the CMS, not the lang file', function () {
|
||
CmsArticle::factory()->create([
|
||
'slug' => 'escrow-system-dubai-investoren',
|
||
'title' => 'Im CMS geänderter Titel',
|
||
'is_published' => true,
|
||
'order' => 1,
|
||
'content' => ['de' => ['intro' => 'Im CMS geänderter Einstieg.', 'sections' => []]],
|
||
]);
|
||
|
||
$this->get('/magazin')
|
||
->assertSuccessful()
|
||
->assertSee('Im CMS geänderter Titel');
|
||
|
||
$this->get('/magazin/escrow-system-dubai-investoren')
|
||
->assertSuccessful()
|
||
->assertSee('Im CMS geänderter Titel');
|
||
});
|
||
|
||
it('hides unpublished articles from the list and returns 404 on their detail page', function () {
|
||
CmsArticle::factory()->create([
|
||
'slug' => 'noch-nicht-fertig',
|
||
'title' => 'Entwurf, noch nicht öffentlich',
|
||
'is_published' => false,
|
||
'order' => 1,
|
||
]);
|
||
|
||
// Ein veroeffentlichter Artikel muss existieren, sonst greift der Lang-Fallback.
|
||
CmsArticle::factory()->create([
|
||
'slug' => 'escrow-system-dubai-investoren',
|
||
'title' => 'Veröffentlicht',
|
||
'is_published' => true,
|
||
'order' => 2,
|
||
]);
|
||
|
||
$this->get('/magazin')
|
||
->assertSuccessful()
|
||
->assertDontSee('Entwurf, noch nicht öffentlich');
|
||
|
||
$this->get('/magazin/noch-nicht-fertig')->assertNotFound();
|
||
});
|
||
|
||
it('falls back to the lang file while no articles are maintained', function () {
|
||
expect(CmsArticle::count())->toBe(0);
|
||
|
||
$this->get('/magazin')
|
||
->assertSuccessful()
|
||
->assertSee('Küche planen', false)
|
||
->assertDontSee('Local for Local');
|
||
});
|
||
|
||
it('prefers the CMS over the lang file once articles exist', function () {
|
||
CmsArticle::factory()->create([
|
||
'slug' => 'nur-dieser-eine',
|
||
'title' => 'Einziger gepflegter Artikel',
|
||
'is_published' => true,
|
||
'order' => 1,
|
||
]);
|
||
|
||
$this->get('/magazin')
|
||
->assertSuccessful()
|
||
->assertSee('Einziger gepflegter Artikel')
|
||
->assertDontSee('Al Jaddaf');
|
||
});
|
||
|
||
// ========================================
|
||
// Neue Interior-Beiträge
|
||
// ========================================
|
||
|
||
it('leads the list with the interior articles, not with the dubai ones', function () {
|
||
$slugs = array_keys(CmsArticle::forFrontend());
|
||
|
||
expect($slugs[0])->toBe('massanfertigung-warum-der-millimeter-zaehlt')
|
||
->and($slugs[1])->toBe('kueche-planen-vom-wunsch-zum-grundriss');
|
||
});
|
||
|
||
it('serves the two new articles by their own slug', function () {
|
||
$this->get('/magazin/massanfertigung-warum-der-millimeter-zaehlt')
|
||
->assertSuccessful()
|
||
->assertSee('Nach Maß statt von der Stange', false);
|
||
|
||
$this->get('/magazin/kueche-planen-vom-wunsch-zum-grundriss')
|
||
->assertSuccessful()
|
||
->assertSee('Küche planen', false);
|
||
});
|
||
|
||
it('does not invent legacy numeric urls for the new articles', function () {
|
||
// Die Slugs kommen aus der Lang-Datei, nicht aus LEGACY_ID_TO_SLUG – /magazin/6 gab es nie.
|
||
expect(CmsArticle::slugForLegacyId(6))->toBeNull();
|
||
|
||
$this->get('/magazin/6')->assertNotFound();
|
||
});
|
||
|
||
it('takes the slug from the lang entry when one is given', function () {
|
||
expect(CmsArticle::slugForLangArticle(6, ['slug' => 'eigener-slug']))->toBe('eigener-slug')
|
||
->and(CmsArticle::slugForLangArticle(1, []))->toBe('escrow-system-dubai-investoren')
|
||
->and(CmsArticle::slugForLangArticle(99, []))->toBeNull();
|
||
});
|