Spoke-Frontend-Audit: Fake-Inhalte raus, Newsletter-Rueckbau, echte Boersendaten, EN-Lokalisierung
Frontend-Umbau (Kevin, 06.07.2026), Ergebnis des businessportal24-Audits: - Fake-Anzeigen und Mock-/Fallback-Daten entfernt (focus-ad, feed-ad, highlight-card, press-release-card, featured-releases, press-releases-grid); Sektionen rendern nur noch mit echten Daten oder gar nicht - Newsletter-Strip und Newsletter-Box zurueckgebaut (Feature nachgelagert, vor Reaktivierung DOI-Flow noetig) - Echte Boersendaten: MarketDataService (Yahoo-Finance-Quotes, config/market.php, Cache) + market:refresh alle 15 Min. im Scheduler; live-ticker blendet sich ohne Daten aus - EN-Lokalisierung der Kern-Seiten via lang/de/web.php + lang/en/web.php; Carbon-Locale folgt app()->getLocale() - Web-Tests auf den neuen Frontend-Stand nachgezogen (Suite: 993 gruen) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
5d199f0130
commit
b3474a36e9
67 changed files with 1735 additions and 1521 deletions
|
|
@ -7,8 +7,32 @@ use App\Models\Company;
|
|||
use App\Models\PressRelease;
|
||||
use Tests\TestCase;
|
||||
|
||||
test('businessportal24 homepage renders the editorial shell', function () {
|
||||
test('businessportal24 homepage renders the editorial shell with real data', 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' => 'Shell-Test Meldung',
|
||||
'slug' => 'shell-test-meldung',
|
||||
'published_at' => now()->subHour(),
|
||||
]);
|
||||
|
||||
$this->get('https://businessportal24.test/de')
|
||||
->assertSuccessful()
|
||||
->assertSee('businessportal', false)
|
||||
|
|
@ -16,19 +40,69 @@ test('businessportal24 homepage renders the editorial shell', function () {
|
|||
->assertSeeText('Aktuelle Meldungen')
|
||||
->assertSeeText('Im Fokus')
|
||||
->assertSeeText('Aktive Newsrooms')
|
||||
->assertSeeText('Bleiben Sie informiert')
|
||||
->assertSeeText('Veröffentlichen Sie Ihre Pressemitteilung')
|
||||
->assertSeeText('Redaktioneller Qualitätsstandard')
|
||||
->assertSeeText('Ihre Pressemitteilung, qualitätsgeprüft veröffentlicht')
|
||||
->assertSeeText('Konto anlegen')
|
||||
->assertSeeText('Unser Qualitätsstandard')
|
||||
->assertDontSeeText('redaktionell geprüft')
|
||||
->assertSeeText('AD-HOC')
|
||||
->assertSeeText('Branchen-Index')
|
||||
->assertSeeText('Heute im Fokus')
|
||||
->assertSee('businessportal', false)
|
||||
->assertSee('>24<', false)
|
||||
->assertDontSeeText('führende Plattform')
|
||||
->assertDontSeeText('maximale Reichweite')
|
||||
->assertDontSeeText('Exklusiv-Interview');
|
||||
});
|
||||
|
||||
test('the ad-hoc ticker also renders on subpages', 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' => 'Ticker-Meldung auf Unterseite',
|
||||
'slug' => 'ticker-meldung-auf-unterseite',
|
||||
'published_at' => now()->subHour(),
|
||||
]);
|
||||
|
||||
$this->get('https://businessportal24.test/de/newsrooms')
|
||||
->assertSuccessful()
|
||||
->assertSeeText('AD-HOC')
|
||||
->assertSeeText('Ticker-Meldung auf Unterseite');
|
||||
|
||||
$this->get('https://businessportal24.test/de/preise')
|
||||
->assertSuccessful()
|
||||
->assertSeeText('AD-HOC')
|
||||
->assertSeeText('Ticker-Meldung auf Unterseite');
|
||||
});
|
||||
|
||||
test('businessportal24 homepage hides data sections and shows the empty feed state without content', function () {
|
||||
/** @var TestCase $this */
|
||||
$this->get('https://businessportal24.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('businessportal24 homepage feed only shows published businessportal content', function () {
|
||||
/** @var TestCase $this */
|
||||
$category = Category::factory()->create([
|
||||
|
|
|
|||
|
|
@ -23,6 +23,22 @@ test('both editions render the homepage', function () {
|
|||
$this->get('https://businessportal24.test/en')->assertSuccessful();
|
||||
});
|
||||
|
||||
test('the english edition renders a localized ui', function () {
|
||||
/** @var TestCase $this */
|
||||
$this->get('https://businessportal24.test/en')
|
||||
->assertSuccessful()
|
||||
->assertSeeText('Latest releases')
|
||||
->assertSeeText('Publish your press release')
|
||||
->assertSeeText('Our quality standard')
|
||||
->assertDontSeeText('Aktuelle Meldungen')
|
||||
->assertDontSeeText('Unser Qualitätsstandard');
|
||||
|
||||
$this->get('https://businessportal24.test/de')
|
||||
->assertSuccessful()
|
||||
->assertSeeText('Aktuelle Meldungen')
|
||||
->assertDontSeeText('Latest releases');
|
||||
});
|
||||
|
||||
test('an unsupported edition prefix returns 404', function () {
|
||||
/** @var TestCase $this */
|
||||
$this->get('https://businessportal24.test/fr')->assertNotFound();
|
||||
|
|
|
|||
98
tests/Feature/Web/MarketDataTest.php
Normal file
98
tests/Feature/Web/MarketDataTest.php
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
|
||||
use App\Services\Web\MarketDataService;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
beforeEach(function () {
|
||||
Cache::forget((string) config('market.cache_key'));
|
||||
|
||||
config()->set('market.enabled', true);
|
||||
config()->set('market.symbols', [
|
||||
['label' => 'DAX', 'symbol' => '^GDAXI', 'precision' => 0, 'suffix' => ''],
|
||||
['label' => 'EUR/USD', 'symbol' => 'EURUSD=X', 'precision' => 2, 'suffix' => ''],
|
||||
]);
|
||||
});
|
||||
|
||||
function fakeYahooChart(float $price, float $previousClose): array
|
||||
{
|
||||
return [
|
||||
'chart' => [
|
||||
'result' => [
|
||||
['meta' => ['regularMarketPrice' => $price, 'chartPreviousClose' => $previousClose]],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
it('holt Kurse, berechnet Deltas und cacht die Slides', function () {
|
||||
Http::fake([
|
||||
'*GDAXI*' => Http::response(fakeYahooChart(24150.0, 24000.0)),
|
||||
'*EURUSD*' => Http::response(fakeYahooChart(1.0815, 1.0902)),
|
||||
]);
|
||||
|
||||
$slides = app(MarketDataService::class)->refresh();
|
||||
|
||||
expect($slides)->toHaveCount(2)
|
||||
->and($slides[0]['label'])->toBe('DAX')
|
||||
->and($slides[0]['value'])->toBe('24.150')
|
||||
->and($slides[0]['delta'])->toBe('+0,6%')
|
||||
->and($slides[0]['positive'])->toBeTrue()
|
||||
->and($slides[1]['delta'])->toBe('-0,8%')
|
||||
->and($slides[1]['positive'])->toBeFalse();
|
||||
|
||||
Http::fake();
|
||||
|
||||
expect(app(MarketDataService::class)->slides())->toBe($slides);
|
||||
});
|
||||
|
||||
it('behält den Cache-Stand, wenn der Abruf komplett fehlschlägt', function () {
|
||||
Cache::put((string) config('market.cache_key'), [
|
||||
['label' => 'DAX', 'value' => '24.150', 'delta' => '+0,6%', 'positive' => true],
|
||||
], 3600);
|
||||
|
||||
Http::fake(['*' => Http::response(null, 500)]);
|
||||
|
||||
$slides = app(MarketDataService::class)->refresh();
|
||||
|
||||
expect($slides)->toHaveCount(1)
|
||||
->and($slides[0]['value'])->toBe('24.150');
|
||||
});
|
||||
|
||||
it('liefert keine Slides, wenn Marktdaten deaktiviert sind', function () {
|
||||
config()->set('market.enabled', false);
|
||||
|
||||
Cache::put((string) config('market.cache_key'), [
|
||||
['label' => 'DAX', 'value' => '24.150', 'delta' => '+0,6%', 'positive' => true],
|
||||
], 3600);
|
||||
|
||||
expect(app(MarketDataService::class)->slides())->toBe([]);
|
||||
});
|
||||
|
||||
it('überspringt Symbole mit unbrauchbarer API-Antwort', function () {
|
||||
Http::fake([
|
||||
'*GDAXI*' => Http::response(['chart' => ['result' => [['meta' => []]]]]),
|
||||
'*EURUSD*' => Http::response(fakeYahooChart(1.0815, 1.0902)),
|
||||
]);
|
||||
|
||||
$slides = app(MarketDataService::class)->refresh();
|
||||
|
||||
expect($slides)->toHaveCount(1)
|
||||
->and($slides[0]['label'])->toBe('EUR/USD');
|
||||
});
|
||||
|
||||
it('aktualisiert Kurse über den Artisan-Command', function () {
|
||||
Http::fake(['*' => Http::response(fakeYahooChart(24150.0, 24000.0))]);
|
||||
|
||||
$this->artisan('market:refresh')
|
||||
->expectsOutputToContain('DAX')
|
||||
->assertSuccessful();
|
||||
|
||||
expect(app(MarketDataService::class)->slides())->not->toBeEmpty();
|
||||
});
|
||||
|
||||
it('meldet einen Fehlschlag des Commands ohne Kursdaten', function () {
|
||||
Http::fake(['*' => Http::response(null, 500)]);
|
||||
|
||||
$this->artisan('market:refresh')->assertFailed();
|
||||
});
|
||||
|
|
@ -7,8 +7,32 @@ use App\Models\Company;
|
|||
use App\Models\PressRelease;
|
||||
use Tests\TestCase;
|
||||
|
||||
test('presseecho homepage renders the editorial shell', function () {
|
||||
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)
|
||||
|
|
@ -16,14 +40,28 @@ test('presseecho homepage renders the editorial shell', function () {
|
|||
->assertSeeText('Aktuelle Meldungen')
|
||||
->assertSeeText('Im Fokus')
|
||||
->assertSeeText('Aktive Newsrooms')
|
||||
->assertSeeText('Bleiben Sie informiert')
|
||||
->assertSeeText('Veröffentlichen Sie Ihre Pressemitteilung')
|
||||
->assertSeeText('Redaktioneller Qualitätsstandard')
|
||||
->assertSeeText('Ihre Pressemitteilung, qualitätsgeprüft 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 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([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue