presseportale/tests/Feature/Web/Businessportal24HomeTest.php
Kevin Adametz 0a3e52d603 19-05-2026 Rebrand Pressekonto, Hub-Flux UI und Legacy-Media-Migration
Umbenennung presseportale → pressekonto in Domains, Themes und Dokumentation.
Design-Tokens, Portal-Shell, Customer-Dashboard, Auth- und Admin-PM-Views.
Artisan-Befehl migrate:legacy-media mit Tests und Hub-Flux-Entwicklungsdocs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 16:36:13 +00:00

144 lines
4.6 KiB
PHP

<?php
use App\Enums\Portal;
use App\Enums\PressReleaseStatus;
use App\Models\Category;
use App\Models\Company;
use App\Models\PressRelease;
use Tests\TestCase;
test('businessportal24 homepage renders the editorial shell', function () {
/** @var TestCase $this */
$this->get('https://businessportal24.test/')
->assertSuccessful()
->assertSee('businessportal', false)
->assertSeeText('Pressemitteilungen · DACH')
->assertSeeText('Aktuelle Meldungen')
->assertSeeText('Im Fokus')
->assertSeeText('Aktive Newsrooms')
->assertSeeText('Bleiben Sie informiert')
->assertSeeText('Veröffentlichen Sie Ihre Pressemitteilung')
->assertSeeText('Redaktioneller Qualitätsstandard')
->assertSeeText('AD-HOC')
->assertSeeText('Termine & Events')
->assertSeeText('Branchen-Index')
->assertSeeText('Heute im Fokus')
->assertSee('businessportal', false)
->assertSee('>24<', false)
->assertDontSeeText('führende Plattform')
->assertDontSeeText('maximale Reichweite')
->assertDontSeeText('Exklusiv-Interview');
});
test('businessportal24 homepage feed only shows published businessportal content', function () {
/** @var TestCase $this */
$category = Category::factory()->create([
'portal' => Portal::Businessportal24,
]);
$category->translations()->create([
'locale' => 'de',
'name' => 'Energie & Klima',
'slug' => 'energie-klima',
]);
$company = Company::factory()->businessportal24()->create([
'name' => 'Muster Energie GmbH',
]);
PressRelease::factory()
->published()
->forPortal(Portal::Businessportal24)
->for($category)
->for($company)
->create([
'title' => 'BusinessPortal24 sichtbare Meldung',
'slug' => 'businessportal24-sichtbare-meldung',
'published_at' => now()->subDay(),
]);
PressRelease::factory()
->published()
->forPortal(Portal::Both)
->for($category)
->for($company)
->create([
'title' => 'Gemeinsame sichtbare Meldung',
'slug' => 'gemeinsame-sichtbare-meldung',
'published_at' => now()->subDays(2),
]);
PressRelease::factory()
->published()
->forPortal(Portal::Presseecho)
->for($category)
->for($company)
->create([
'title' => 'Presseecho nicht sichtbar',
'slug' => 'presseecho-nicht-sichtbar',
'published_at' => now()->subDay(),
]);
PressRelease::factory()
->forPortal(Portal::Businessportal24)
->for($category)
->for($company)
->create([
'title' => 'Entwurf nicht sichtbar',
'slug' => 'entwurf-nicht-sichtbar',
'status' => PressReleaseStatus::Draft,
'published_at' => now()->subDay(),
]);
$this->get('https://businessportal24.test/')
->assertSuccessful()
->assertSeeText('BusinessPortal24 sichtbare Meldung')
->assertSeeText('Gemeinsame sichtbare Meldung')
->assertDontSeeText('Presseecho nicht sichtbar')
->assertDontSeeText('Entwurf nicht sichtbar');
});
test('businessportal24 homepage shows most read releases in the sidebar', function () {
/** @var TestCase $this */
$category = Category::factory()->create([
'portal' => Portal::Businessportal24,
]);
$category->translations()->create([
'locale' => 'de',
'name' => 'Technologie',
'slug' => 'technologie',
]);
$company = Company::factory()->businessportal24()->create([
'name' => 'Trending Corp',
]);
PressRelease::factory()
->published()
->forPortal(Portal::Businessportal24)
->for($category)
->for($company)
->create([
'title' => 'Meistgelesene BP24-Meldung',
'slug' => 'meistgelesene-bp24-meldung',
'hits' => 99999,
'published_at' => now()->subDays(3),
]);
PressRelease::factory()
->published()
->forPortal(Portal::Businessportal24)
->for($category)
->for($company)
->create([
'title' => 'Wenig gelesene BP24-Meldung',
'slug' => 'wenig-gelesene-bp24-meldung',
'hits' => 5,
'published_at' => now()->subDays(2),
]);
$this->get('https://businessportal24.test/')
->assertSuccessful()
->assertSeeText('Meistgelesen')
->assertSeeText('Meistgelesene BP24-Meldung')
->assertSeeText('Trending Corp');
});