presseportale/tests/Feature/Web/PricingTeaserTest.php
Kevin Adametz 028b059975
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
Editorial-Frontend: oeffentliche Unterseiten, Preise & Linkpflege
Oeffentliche Strecke durchgaengig auf das Editorial-Design umgestellt und
datengetrieben gemacht:

- Newsrooms-Verzeichnis + Newsroom-Detailseiten (Suche, Pagination)
- Preise-Seite neu (Abos via Plan, Einzel-PM via config/billing, Add-ons via
  config/credits); Texte ausgelagert nach lang/{de,en}/pricing.php
- Pricing-Teaser-Komponente auf den Startseiten + Preise-Link in Header/Footer
- Statische Seiten im Editorial-Design ueber neue Komponente x-web.static-page:
  impressum, datenschutz, agb, cookies, faq (Akkordeon), hilfe, kontakt,
  ueber-uns, api (altes Theme/gradient-hero entfernt)
- Header/Footer-Linkpflege: tote #-Anker raus, FAQ/Hilfe/Cookies verlinkt,
  "Anmelden" fuehrt in den Hub
- Legacy-URL-Redirects (.html, presskit->newsroom, Regionen)
- Datums-Bugfix in Feed-Komponenten

Tests: NewsroomPage, PreisePage, PricingTeaser, StaticPages, NavigationLinks,
LegacyRedirect. Doku in docs/frontend aktualisiert.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 16:08:46 +00:00

54 lines
1.8 KiB
PHP

<?php
use App\Models\Plan;
use Database\Seeders\PlanSeeder;
use Tests\TestCase;
test('the homepage renders active plans from the system in the pricing teaser', function () {
/** @var TestCase $this */
$this->seed(PlanSeeder::class);
$this->get('https://businessportal24.test/de')
->assertSuccessful()
->assertSeeText('Tarife & Pakete')
->assertSeeText('Starter')
->assertSeeText('Business')
->assertSeeText('Pro')
->assertSeeText('Agency')
// Jahrespreis-Kommunikation und Live-Preis (Agency 199 €).
->assertSeeText('2 Monate gratis')
->assertSee('199')
->assertSeeText('Auswählen')
->assertSeeText('Beliebt');
});
test('the pricing teaser hides inactive plans', function () {
/** @var TestCase $this */
Plan::factory()->create(['name' => 'Sichtbarer Tarif', 'is_active' => true]);
Plan::factory()->inactive()->create(['name' => 'Versteckter Tarif']);
$this->get('https://businessportal24.test/de')
->assertSuccessful()
->assertSeeText('Sichtbarer Tarif')
->assertDontSeeText('Versteckter Tarif');
});
test('the pricing teaser is omitted when no plans exist but the page still works', function () {
/** @var TestCase $this */
expect(Plan::query()->count())->toBe(0);
$this->get('https://businessportal24.test/de')
->assertSuccessful()
->assertDontSeeText('Auswählen');
});
test('the header links to the pricing page on every portal page', function () {
/** @var TestCase $this */
$this->get('https://businessportal24.test/de')
->assertSuccessful()
->assertSee('/de/preise');
$this->get('https://presseecho.test/de')
->assertSuccessful()
->assertSee('/de/preise');
});