57 lines
2.3 KiB
PHP
57 lines
2.3 KiB
PHP
<?php
|
|
|
|
use App\Models\Plan;
|
|
use Database\Seeders\PlanSeeder;
|
|
use Tests\TestCase;
|
|
|
|
test('the pricing page renders the editorial shell with real plans, single pm and add-ons', function () {
|
|
/** @var TestCase $this */
|
|
$this->seed(PlanSeeder::class);
|
|
|
|
$this->get('https://businessportal24.test/de/preise')
|
|
->assertSuccessful()
|
|
// Editorial-Masthead (Inhalte aus lang/de/pricing.php)
|
|
->assertSeeText('Transparente Preise für jede Reichweite')
|
|
// 1) Abo-Tarife (echte Pläne aus dem System)
|
|
->assertSeeText('Abo-Tarife mit Monatskontingent')
|
|
->assertSeeText('Starter')
|
|
->assertSeeText('Business')
|
|
->assertSeeText('Pro')
|
|
->assertSeeText('Agency')
|
|
// 2) Einzel-Pressemitteilung (config/billing)
|
|
->assertSeeText('Einzel-Pressemitteilung')
|
|
->assertSeeText('pro Veröffentlichung')
|
|
// 3) Add-ons (config/credits)
|
|
->assertSeeText('Add-ons & Einzelkosten')
|
|
->assertSeeText('Extra-Pressemitteilung')
|
|
->assertSeeText('Boost-Platzierung')
|
|
->assertSeeText('Veröffentlichungsnachweis (PDF)')
|
|
->assertSeeText('Credit-Pakete')
|
|
->assertSeeText('7 Tage') // boost 7d aus config
|
|
->assertSeeText('10 Credits') // Credit-Paket p10 aus config
|
|
->assertSeeText('Depublizieren')
|
|
->assertSeeText('35 Credits'); // depublish aus config
|
|
});
|
|
|
|
test('the pricing page serves english content on the english edition', function () {
|
|
/** @var TestCase $this */
|
|
$this->seed(PlanSeeder::class);
|
|
|
|
$this->get('https://businessportal24.test/en/preise')
|
|
->assertSuccessful()
|
|
->assertSeeText('Transparent pricing for every reach')
|
|
->assertSeeText('Subscriptions with a monthly quota')
|
|
->assertSeeText('Single press release')
|
|
->assertSeeText('Add-ons & individual costs');
|
|
});
|
|
|
|
test('the pricing page still works and shows an empty hint without plans', function () {
|
|
/** @var TestCase $this */
|
|
expect(Plan::query()->count())->toBe(0);
|
|
|
|
$this->get('https://businessportal24.test/de/preise')
|
|
->assertSuccessful()
|
|
->assertSeeText('Tarife werden in Kürze veröffentlicht.')
|
|
// Add-ons sind config-basiert und unabhängig von Tarifen sichtbar.
|
|
->assertSeeText('Add-ons & Einzelkosten');
|
|
});
|