Arbeitsplan 14.09.2026, Punkte 1.1 bis 1.4 (Nachträge 6 bis 10 im Entwicklungsplan): - Farbwelt Interior (Tanne, Creme, Sand, Ocker, Clay) als Standard, Immobilien-Welt behält das bisherige Blau über body.world-immobilien; Logo je Welt, Favicons neu, Welten-Wechsler in Kopf- und Fußzeile. - Saubere Trennung der Welten: eigene Navigation, Ankündigungsleiste, Magazinliste, Über-uns-Seite, FAQ, Kontaktseite und Abschluss-CTA für Immobilien; Beiträge tragen eine Welt (Migration + Admin-Feld). Abschluss-CTA Ton in Ton statt Grün-zu-Ocker. - Kontakt: Betreffe in Gruppen Interior / Immobilien / B2in, Marken darin. Terminanfrage-Buttons öffnen das Widget mit vorgewähltem Anliegen; Select-Felder einheitlich gestaltet. - Tischlerei als vierte Kernmarke (Platzhalter), Kachelraster 2×2. - Herkunfts-Sektion „Aus der Region gefertigt“ mit schematischer Standortkarte und Ablauf CABINET (Beratung Bielefeld, Fertigung Köln, Aufbau mit Tischlerei). Deployment: migrate, WorldSplitCmsSeeder, CmsBrandSeeder, OriginSectionCmsSeeder (Abschnitt 8 im Entwicklungsplan). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
180 lines
5.9 KiB
PHP
180 lines
5.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('Supply-Chain-Management')
|
||
->assertSee('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('magazin detail page loads for the last article', function () {
|
||
$this->get('/magazin/local-for-local-regionaler-moebelhandel')
|
||
->assertSuccessful()
|
||
->assertSee('Local for Local')
|
||
->assertSee('Support your Locals');
|
||
});
|
||
|
||
it('serves every article by its slug', function () {
|
||
foreach (CmsArticle::LEGACY_ID_TO_SLUG as $slug) {
|
||
$this->get('/magazin/'.$slug)->assertSuccessful();
|
||
}
|
||
});
|
||
|
||
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('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();
|
||
});
|