- App\Support\ImageCredit: Foto/Quelle-Zeile, KI-Hinweis mit Herkunft, Verantwortlich-Zeile nur mit Protokoll, sichere Links; PDF-Zeilen mit Bestätigungskennung - Artikelseite: Overlay (eigenes i-Zeichen, Alpine ohne Plugin, Bottom-Sheet auf Mobil) mit Nachweis, Lizenz, Quelle, KI-Hinweis, Verantwortlich-Zeile, „Bild melden" - Richtlinien 0.2: Prüfung als automatisiert beschrieben, Abschnitt „Bilder" (Decision-Update 3.5); Taglines, Suche, Newsrooms, Startseiten-CTA, Mails ohne „qualitätsgeprüft" - Cache-Invalidierung bei Bildwechsel an veröffentlichten Meldungen; PHPStan-Baseline für das Resource bereinigt Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
209 lines
6.6 KiB
PHP
209 lines
6.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('presseecho homepage renders the editorial shell with real data', function () {
|
|
/** @var TestCase $this */
|
|
$category = Category::factory()->create([
|
|
'portal' => Portal::Presseecho,
|
|
]);
|
|
$category->translations()->create([
|
|
'locale' => 'de',
|
|
'name' => 'Energie & Klima',
|
|
'slug' => 'energie-klima',
|
|
]);
|
|
|
|
$company = Company::factory()->presseecho()->create([
|
|
'name' => 'Muster Energie GmbH',
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Shell-Test Meldung',
|
|
'slug' => 'shell-test-meldung',
|
|
'published_at' => now()->subHour(),
|
|
]);
|
|
|
|
$this->get('https://presseecho.test/de')
|
|
->assertSuccessful()
|
|
->assertSee('presseecho', false)
|
|
->assertSeeText('Pressemitteilungen · DACH')
|
|
->assertSeeText('Aktuelle Meldungen')
|
|
->assertSeeText('Im Fokus')
|
|
->assertSeeText('Aktive Newsrooms')
|
|
->assertSeeText('Veröffentlichen Sie Ihre Pressemitteilung')
|
|
->assertSeeText('Ihre Pressemitteilung, automatisiert geprüft und veröffentlicht')
|
|
->assertSeeText('Konto anlegen')
|
|
->assertSeeText('Unser Qualitätsstandard')
|
|
->assertDontSeeText('redaktionell geprüft')
|
|
->assertSeeText('AD-HOC')
|
|
->assertSeeText('Branchen-Index')
|
|
->assertSeeText('Heute im Fokus');
|
|
});
|
|
|
|
test('presseecho homepage shows the ad slot self-promotion in the hero sidebar', function () {
|
|
/** @var TestCase $this */
|
|
$category = Category::factory()->create([
|
|
'portal' => Portal::Presseecho,
|
|
]);
|
|
$category->translations()->create([
|
|
'locale' => 'de',
|
|
'name' => 'Energie & Klima',
|
|
'slug' => 'energie-klima',
|
|
]);
|
|
|
|
$company = Company::factory()->presseecho()->create();
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Ad-Slot Hero Meldung',
|
|
'slug' => 'ad-slot-hero-meldung',
|
|
'published_at' => now()->subHour(),
|
|
]);
|
|
|
|
$this->get('https://presseecho.test/de')
|
|
->assertSuccessful()
|
|
->assertSeeText('Hier könnte Ihre Werbung stehen')
|
|
->assertSeeText('Jetzt Werbeplatz anfragen')
|
|
// Klick öffnet das Kontakt-Widget mit vorgewähltem Thema „Werbeanfrage".
|
|
->assertSee('open-contact-modal', false)
|
|
->assertSee("{ topic: 'advertising' }", false);
|
|
});
|
|
|
|
test('presseecho homepage hides data sections and shows the empty feed state without content', function () {
|
|
/** @var TestCase $this */
|
|
$this->get('https://presseecho.test/de')
|
|
->assertSuccessful()
|
|
->assertSeeText('Aktuelle Meldungen')
|
|
->assertSeeText('Aktuell liegen keine Meldungen vor')
|
|
->assertDontSeeText('Im Fokus')
|
|
->assertDontSeeText('Aktive Newsrooms')
|
|
->assertDontSeeText('Branchen-Index')
|
|
->assertDontSeeText('Heute im Fokus');
|
|
});
|
|
|
|
test('presseecho homepage feed only shows published presseecho content', function () {
|
|
/** @var TestCase $this */
|
|
$category = Category::factory()->create([
|
|
'portal' => Portal::Presseecho,
|
|
]);
|
|
$category->translations()->create([
|
|
'locale' => 'de',
|
|
'name' => 'Energie & Klima',
|
|
'slug' => 'energie-klima',
|
|
]);
|
|
|
|
$company = Company::factory()->presseecho()->create([
|
|
'name' => 'Muster Energie GmbH',
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Presseecho sichtbare Meldung',
|
|
'slug' => 'presseecho-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::Businessportal24)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Businessportal24 nicht sichtbar',
|
|
'slug' => 'businessportal24-nicht-sichtbar',
|
|
'published_at' => now()->subDay(),
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Entwurf nicht sichtbar',
|
|
'slug' => 'entwurf-nicht-sichtbar',
|
|
'status' => PressReleaseStatus::Draft,
|
|
'published_at' => now()->subDay(),
|
|
]);
|
|
|
|
$this->get('https://presseecho.test/de')
|
|
->assertSuccessful()
|
|
->assertSeeText('Presseecho sichtbare Meldung')
|
|
->assertSeeText('Gemeinsame sichtbare Meldung')
|
|
->assertDontSeeText('Businessportal24 nicht sichtbar')
|
|
->assertDontSeeText('Entwurf nicht sichtbar');
|
|
});
|
|
|
|
test('presseecho homepage shows most read releases in the sidebar', function () {
|
|
/** @var TestCase $this */
|
|
$category = Category::factory()->create([
|
|
'portal' => Portal::Presseecho,
|
|
]);
|
|
$category->translations()->create([
|
|
'locale' => 'de',
|
|
'name' => 'Technologie',
|
|
'slug' => 'technologie',
|
|
]);
|
|
|
|
$company = Company::factory()->presseecho()->create([
|
|
'name' => 'Trending Corp',
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Meistgelesene Presseecho-Meldung',
|
|
'slug' => 'meistgelesene-presseecho-meldung',
|
|
'hits' => 99999,
|
|
'published_at' => now()->subDays(3),
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Wenig gelesene Presseecho-Meldung',
|
|
'slug' => 'wenig-gelesene-presseecho-meldung',
|
|
'hits' => 5,
|
|
'published_at' => now()->subDays(2),
|
|
]);
|
|
|
|
$this->get('https://presseecho.test/de')
|
|
->assertSuccessful()
|
|
->assertSeeText('Meistgelesen')
|
|
->assertSeeText('Meistgelesene Presseecho-Meldung')
|
|
->assertSeeText('Trending Corp');
|
|
});
|