User-Panel-Restarbeiten: PM-Guard, Profil-Rework, USt-ID-Prüfung, Buchungspflicht-Adresse

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-06-12 14:36:18 +00:00
parent 036a53499f
commit afcca34f91
25 changed files with 905 additions and 140 deletions

View file

@ -0,0 +1,34 @@
<?php
use App\Models\Company;
use App\Models\User;
use Livewire\Volt\Volt as LivewireVolt;
use Tests\TestCase;
test('the pm create page shows a notice instead of the form without a company', function () {
/** @var TestCase $this */
$customer = User::factory()->create(['is_active' => true]);
$this->actingAs($customer);
LivewireVolt::test('customer.press-releases.create')
->assertSet('hasCompanies', false)
->assertSee('Ohne Firma kann keine Pressemitteilung angelegt werden.')
->assertSee('Firma anlegen')
->assertDontSee('Zur Prüfung senden');
});
test('the pm create page shows the editor when a company exists', function () {
/** @var TestCase $this */
$customer = User::factory()->create(['is_active' => true]);
$company = Company::factory()->presseecho()->create();
$customer->companies()->attach($company->id, ['role' => 'owner']);
$this->actingAs($customer);
LivewireVolt::test('customer.press-releases.create')
->assertSet('hasCompanies', true)
->assertSet('companyId', $company->id)
->assertDontSee('Ohne Firma kann keine Pressemitteilung angelegt werden.')
->assertSee('Zur Prüfung senden');
});