presseportale/tests/Feature/PressReleaseWithdrawalWaiverTest.php
Kevin Adametz 2cde7284a1 livewire: Volt entfernt — Komponenten als Livewire-4-Single-File-Components, Route::livewire(), Livewire::test(); livewire/volt deinstalliert
- 83 Komponenten: Livewire\Volt\Component → Livewire\Component
- 73 Routen (admin, auth, customer): Volt::route() → Route::livewire()
- 88 Testdateien: Volt::test/actingAs → Livewire::test/actingAs
- VoltServiceProvider gelöscht; composer remove livewire/volt
- config/livewire.php auf v4-Schlüssel (component_layout, component_placeholder,
  component_locations, make_command: SFC ohne ⚡). Der alte Schlüssel layout war
  wirkungslos; alle gerouteten Komponenten setzen ihr Layout selbst.
- CLAUDE.md, AGENTS.md, boost.json, .cursorrules, Skill volt-development
- Roadmap: erledigt; Larastan erfasst SFCs weiterhin nicht (Blade-Dateien)

Suite 2.325 grün, einer übersprungen; Larastan und Pint ohne Meldung;
route:cache und view:cache laufen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 13:59:36 +00:00

62 lines
2.3 KiB
PHP

<?php
use App\Enums\AiTextDeclaration;
use App\Enums\PressReleaseStatus;
use Database\Seeders\RolesAndPermissionsSeeder;
use Illuminate\Support\Facades\Queue;
use Livewire\Livewire;
use Tests\TestCase;
beforeEach(function (): void {
/** @var TestCase $this */
$this->seed(RolesAndPermissionsSeeder::class);
Queue::fake();
});
test('the submit modal requires the archive notice confirmation', function () {
/** @var TestCase $this */
['customer' => $customer, 'pr' => $pr] = makeCustomerForShowPhase8a();
$this->actingAs($customer);
Livewire::test('customer.press-releases.show', ['id' => $pr->id])
// Archiv-Hinweis (AGB § 13 Abs. 1, T2neu) als eigene Bestätigung —
// die frühere Erlöschens-Checkbox entfiel mit B2B-only (E2) …
->assertSee('dauerhaft archiviert')
->assertSee('gesetzliche Ansprüche bleiben unberührt')
// … die den Bestätigen-Button mit sperrt.
->assertSeeHtml('agb && images && contact && waiver');
});
test('submitting records the archive notice consent timestamp on the press release', function () {
/** @var TestCase $this */
['customer' => $customer, 'pr' => $pr] = makeCustomerForShowPhase8a();
$this->actingAs($customer);
expect($pr->withdrawal_waiver_consented_at)->toBeNull();
Livewire::test('customer.press-releases.show', ['id' => $pr->id])
// KI-Kennzeichnung (Art. 50 KI-VO) ist Pflicht im Submit-Modal.
->set('aiTextDeclaration', AiTextDeclaration::None->value)
->set('aiDeclarationConfirmed', true)
->call('submitForReview')
->assertHasNoErrors();
$pr->refresh();
expect($pr->status)->toBe(PressReleaseStatus::Review);
expect($pr->withdrawal_waiver_consented_at)->not->toBeNull();
});
test('the index draft action opens the shared submit modal instead of a quick submit', function () {
/** @var TestCase $this */
['customer' => $customer] = makeCustomerForShowPhase8a();
$this->actingAs($customer);
Livewire::test('customer.press-releases.index')
->assertSee('Zur Prüfung')
// Gemeinsames Modal inkl. Archiv-Hinweis statt wire:confirm,
// das die rechtlichen Bestätigungen umgehen würde.
->assertSee('dauerhaft archiviert')
->assertDontSeeHtml('wire:confirm');
});