presseportale/tests/Feature/PressReleaseWithdrawalWaiverTest.php
Kevin Adametz fc13038073 T2neu: Archiv-Hinweis vor Submit ersetzt Erloeschens-Checkbox (B2B, E2)
Die 356-BGB-Erlöschensbestätigung entfiel mit der B2B-Umstellung; an ihre
Stelle tritt der von AGB par. 13 Abs. 1 geforderte Hinweis auf die
dauerhafte Archivierung (Depublikation nur als kostenpflichtiger Service,
gesetzliche Ansprueche unberuehrt). Bestätigungszeitpunkt wird weiter
protokolliert (Spalte withdrawal_waiver_consented_at, historischer Name).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 15:53:22 +00:00

58 lines
2.1 KiB
PHP

<?php
use App\Enums\PressReleaseStatus;
use Database\Seeders\RolesAndPermissionsSeeder;
use Illuminate\Support\Facades\Queue;
use Livewire\Volt\Volt as LivewireVolt;
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);
LivewireVolt::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();
LivewireVolt::test('customer.press-releases.show', ['id' => $pr->id])
->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);
LivewireVolt::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');
});